| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeCoverageImport.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00029 #ifndef  __TERRALIB_INTERNAL_COVERAGEIMPORT_H
    00030 #define  __TERRALIB_INTERNAL_COVERAGEIMPORT_H
    00031
    00032 #include <sstream>
    00033
    00034 #include "TeCoverageParams.h"
    00035 #include "TeCoverageUtils.h"
    00036 #include "TeCoverageImportUtils.h"
    00037 #include <TeQuerier.h>
    00038 #include <TeQuerierParams.h>
    00039 //#include "TeDriverSHPDBF.h"
    00040
    00045 #define WRITE(data, t, v) *((t*)(data)) = v;  data += sizeof(t)
    00046
    00047
    00052 template <class T>
    00053 struct SerializedPair {
    00054     T geom;
    00055     unsigned char* data;
    00056     unsigned long size;
    00057 };
    00058
    00059 template <class T>
    00060 struct CmpSerializedX {
    00061     bool operator() (SerializedPair<T>* s1, SerializedPair<T>* s2)
    00062     {
    00063         return s1->geom.box().center().x() < s2->geom.box().center().x();
    00064     }
    00065 };
    00066
    00067 template <class T>
    00068 struct CmpSerializedY {
    00069     bool operator() (SerializedPair<T>* s1, SerializedPair<T>* s2)
    00070     {
    00071         return s1->geom.box().center().y() < s2->geom.box().center().y();
    00072     }
    00073 };
    00074
    00075 template <class T>
    00076 void
    00077 splitSerialized(std::vector<SerializedPair<T>* >& src,
    00078                 typename std::vector<SerializedPair<T>* >::iterator& begin,
    00079                 typename std::vector<SerializedPair<T>* >::iterator& end,
    00080                 std::vector<std::vector<SerializedPair<T> > >& clusters)
    00081 {
    00082     const int CLUSTER_CAPACITY = 300;
    00083     if ((end - begin) <= CLUSTER_CAPACITY)
    00084     {
    00085         std::vector<SerializedPair<T> >& cluster = std::vector<SerializedPair<T> >();
    00086         for (std::vector<SerializedPair<T>* >::iterator it = begin; it != end; it++)
    00087         {
    00088             SerializedPair<T>* pair = *it;
    00089             cluster.push_back(*pair);
    00090         }
    00091         clusters.push_back(cluster);
    00092         return;
    00093     }
    00094
    00095     TeBox box = TeBox();
    00096     for (std::vector<SerializedPair<T>* >::iterator it = begin; it != end; it++)
    00097     {
    00098         SerializedPair<T>* pair = (*it);
    00099         updateBox(box, pair->geom.box());
    00100     }
    00101
    00102     // split geom set horizontaly if width is larger than height
    00103     if ((box.x2_ - box.x1_) > (box.y2_ - box.y1_))
    00104     {
    00105         sort(begin, end, CmpSerializedX<T>());
    00106     }
    00107     // split verticaly otherwise
    00108     else
    00109     {
    00110         sort(begin, end, CmpSerializedX<T>());
    00111     }
    00112
    00113     std::vector<SerializedPair<T> *>::iterator mid = begin + (((end - begin) + 1) / 2);
    00114     splitSerialized(src, mid, end, clusters);
    00115     splitSerialized(src, begin, mid, clusters);
    00116 }
    00117
    00118 template <class T>
    00119 void
    00120 clusterSerialized(std::vector<SerializedPair<T> >& srcGroup, std::vector<std::vector<SerializedPair<T> > >& clusters)
    00121 {
    00122     std::vector<SerializedPair<T>* >& pairs = std::vector<SerializedPair<T>* >();
    00123
    00124     for (std::vector<SerializedPair<T> >::iterator it = srcGroup.begin(); it != srcGroup.end(); it++)
    00125     {
    00126         SerializedPair<T>& pair = *it;
    00127         pairs.push_back(&pair);
    00128     }
    00129     splitSerialized(pairs, pairs.begin(), pairs.end(), clusters);
    00130 }
    00131
    00132 template <class T>
    00133 void
    00134 populateDatabase(TeLayer* layer, const std::string& coverageId, std::vector<std::vector<SerializedPair<T> > >& groups)
    00135 {
    00136     TeDatabase* db = layer->database();
    00137
    00138     std::string& tableName = TeDefaultCoverageTable(layer, coverageId);
    00139     if (!db->tableExist(tableName))
    00140     {
    00141         createCoverageTable(layer, tableName);
    00142     }
    00143
    00144     // Bounding box of the coverage, to be calculated
    00145     TeBox coverageBox = TeBox();
    00146
    00147     // Iterate over the  collection of grouped points
    00148     std::vector<std::vector<SerializedPair<T> > >::iterator itGroups = groups.begin();
    00149     std::vector<std::vector<SerializedPair<T> > >::iterator endGroups = groups.end();
    00150     int count = 0;
    00151     while (itGroups != endGroups)
    00152     {
    00153         std::vector<SerializedPair<T> >& group = *(itGroups++);
    00154         std::vector<SerializedPair<T> >::iterator itPoints = group.begin();
    00155         std::vector<SerializedPair<T> >::iterator endPoints = group.end();
    00156
    00157         // Calculate block size, according to sizes of serialized points
    00158         unsigned long blockSize = 0;
    00159         while (itPoints != endPoints)
    00160         {
    00161             blockSize += itPoints->size;
    00162             itPoints++;
    00163         }
    00164
    00165         // Allocate enough memory for the block data
    00166         unsigned char* blockData = NULL;
    00167         blockData = (unsigned char*)malloc(blockSize);
    00168
    00169         unsigned char* dest = blockData;
    00170
    00171         // Create bounding box of the group
    00172         TeBox blockBox = TeBox();
    00173
    00174         // Reset iterator and iterate over the serialized points in the group
    00175         itPoints = group.begin();
    00176         while (itPoints != endPoints)
    00177         {
    00178             // Join chunks to the block data
    00179             unsigned char* src = itPoints->data;
    00180             for (unsigned int i = 0; i < itPoints->size; i++)
    00181             {
    00182                 *dest++ = *src++;
    00183             }
    00184
    00185             // Update block bounding box
    00186             updateBox(blockBox, itPoints->geom.box());
    00187
    00188             itPoints++;
    00189         }
    00190
    00191         // Update coverage bounding box
    00192         updateBox(coverageBox, blockBox);
    00193
    00194         count++;
    00195
    00196         // Insert block data as an entry in the coverage block table
    00197         insertToCoverageTable(layer, tableName, count, blockBox, group.size(), blockData, blockSize);
    00198     }
    00199
    00200     // Create coverage layer, if it does not exist
    00201     std::string& layerTableName = TeDefaultCoverageLayerTable(layer);
    00202     if (!db->tableExist(layerTableName))
    00203     {
    00204         createCoverageLayerTable(layer, layerTableName);
    00205     }
    00206     insertToCoverageLayerTable(layer, layerTableName, tableName, coverageId, coverageBox);
    00207
    00208     // Check if this coverage layer is in the representations table
    00209     TeRepresentation* rep = layer->getRepresentation(TeCOVERAGE, layerTableName);
    00210     if (rep != NULL)
    00211     {
    00212         // Update bounding box of the representation
    00213         updateBox(rep->box_, coverageBox);
    00214
    00215         if (!db->updateRepresentation(layer->id(), *rep))
    00216         {
    00217             std::string errorMsg = "Couldn't update representation on layer '" + Te2String(layer->id()) + "'. DB error: \"" + db->errorMessage() + "\"";
    00218             throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
    00219         }
    00220     }
    00221     else
    00222     {
    00223         // Insert entry in the representations table
    00224         TeRepresentation* rep = new TeRepresentation();
    00225         rep->box_ = coverageBox;
    00226         rep->geomRep_ = TeCOVERAGE;
    00227         rep->tableName_ = layerTableName;
    00228         layer->addVectRepres(rep);
    00229
    00230         if (!db->insertRepresentation(layer->id(), *rep))
    00231         {
    00232             std::string errorMsg = "Couldn't insert representation on layer '" + Te2String(layer->id()) + "'. DB error: \"" + db->errorMessage() + "\"";
    00233             throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
    00234         }
    00235     }
    00236
    00237     // Update bounding box of the layer
    00238     layer->updateLayerBox(coverageBox);
    00239     if (!db->updateLayer(layer))
    00240     {
    00241         std::string errorMsg = "Couldn't update layer '" + Te2String(layer->id()) + "'. DB error: \"" + db->errorMessage() + "\"";
    00242         throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
    00243     }
    00244 }
    00245
    00247 bool
    00248 decodeLayer(TeLayer* srcLayer, const std::vector<std::string>& columns, std::vector<SerializedPair<TePoint> >& serializedVector, std::vector<TeCoverageDimension>& dimensions)
    00249 {
    00250     TeQuerierParams querierParams(true, columns);
    00251     querierParams.setParams(srcLayer);
    00252     TeQuerier querier(querierParams);
    00253     querier.loadInstances();
    00254
    00255     // Set information about the coverage dimensions
    00256     TeAttributeList attList = querier.getAttrList();
    00257     attributeListToCoverageDimensions(attList, dimensions);
    00258
    00259     // Size of (x, y) pair
    00260     int chunkSize = (2 * sizeof(double)) + TeCoverageDimensionsSize(dimensions);
    00261
    00262     // Extract coverage data
    00263     unsigned int instanceCount = 0;
    00264     TeSTInstance sti;
    00265     while(querier.fetchInstance(sti))
    00266     {
    00267         if(!sti.hasPoints())
    00268         {
    00269             // If it doesn't have a point, proceed to the next instance
    00270             continue;
    00271         }
    00272
    00273         SerializedPair<TePoint> serialized;
    00274         serialized.size = chunkSize;
    00275
    00276         // Get only the first point
    00277         TePointSet pointSet;
    00278         sti.getGeometry(pointSet);
    00279         TePoint point = *(pointSet.begin());
    00280
    00281         serialized.geom = point;
    00282
    00283         serialized.data = (unsigned char*)malloc(serialized.size);
    00284
    00285         unsigned char* temp = serialized.data;
    00286
    00287         // Write coordinates
    00288         WRITE(temp, double, point.location().x_);
    00289         WRITE(temp, double, point.location().y_);
    00290
    00291         // Write dimensions values
    00292         TePropertyVector vec = sti.getPropertyVector();
    00293         for(unsigned int i = 0; i < vec.size(); i++)
    00294         {
    00295             if (dimensions[i].type == TeINTEGER)
    00296             {
    00297                 std::stringstream buf;
    00298                 buf << vec[i].value_;
    00299                 int val;
    00300                 buf >> val;
    00301                 WRITE(temp, int, val);
    00302                 buf.clear();
    00303             }
    00304             else
    00305             {
    00306                 std::stringstream buf;
    00307                 buf << vec[i].value_;
    00308                 double val;
    00309                 buf >> val;
    00310                 WRITE(temp, double, val);
    00311                 buf.clear();
    00312             }
    00313         }
    00314         serializedVector.push_back(serialized);
    00315
    00316     }
    00317     return true;
    00318 }
    00319
    00320 bool
    00321 decodeLayer(TeLayer* srcLayer, const std::vector<std::string>& columns, std::vector<SerializedPair<TeLine2D> >& serializedVector, std::vector<TeCoverageDimension>& dimensions)
    00322 {
    00323     TeQuerierParams querierParams(true, columns);
    00324     querierParams.setParams(srcLayer);
    00325     TeQuerier querier(querierParams);
    00326     querier.loadInstances();
    00327
    00328     // Set information about the coverage dimensions
    00329     TeAttributeList attList = querier.getAttrList();
    00330     attributeListToCoverageDimensions(attList, dimensions);
    00331
    00332     int dimensionsSize = TeCoverageDimensionsSize(dimensions);
    00333
    00334     // Extract coverage data
    00335     unsigned int instanceCount = 0;
    00336     TeSTInstance sti;
    00337     while(querier.fetchInstance(sti))
    00338     {
    00339         if(!sti.hasLines())
    00340         {
    00341             // If it doesn't have a line, proceed to the next instance
    00342             continue;
    00343         }
    00344
    00345         SerializedPair<TeLine2D> serialized;
    00346
    00347         // Get only the first line
    00348         TeLineSet lineSet;
    00349         sti.getGeometry(lineSet);
    00350         TeLine2D line = *(lineSet.begin());
    00351
    00352         serialized.geom = line;
    00353
    00354         int pointSize = (2 * sizeof(double));
    00355         serialized.size = sizeof(unsigned int) + (line.size() * pointSize) + dimensionsSize;
    00356
    00357         serialized.data = (unsigned char*)malloc(serialized.size);
    00358
    00359         unsigned char* temp = serialized.data;
    00360
    00361         WRITE(temp, unsigned int, line.size());
    00362
    00363         // Write point coordinates
    00364         for (unsigned int i = 0; i < line.size(); ++i)
    00365         {
    00366             TePoint point = line[i];
    00367             WRITE(temp, double, point.location().x_);
    00368             WRITE(temp, double, point.location().y_);
    00369         }
    00370
    00371         // Write dimensions values
    00372         TePropertyVector vec = sti.getPropertyVector();
    00373         for(unsigned int i = 0; i < vec.size(); i++)
    00374         {
    00375             if (dimensions[i].type == TeINTEGER)
    00376             {
    00377                 std::stringstream buf;
    00378                 buf << vec[i].value_;
    00379                 int val;
    00380                 buf >> val;
    00381                 WRITE(temp, int, val);
    00382                 buf.clear();
    00383             }
    00384             else
    00385             {
    00386                 std::stringstream buf;
    00387                 buf << vec[i].value_;
    00388                 double val;
    00389                 buf >> val;
    00390                 WRITE(temp, double, val);
    00391                 buf.clear();
    00392             }
    00393         }
    00394         serializedVector.push_back(serialized);
    00395
    00396     }
    00397     return true;
    00398 }
    00399
    00400 bool
    00401 decodeLayer(TeLayer* srcLayer, const std::vector<std::string>& columns, std::vector<SerializedPair<TePolygon> >& serializedVector, std::vector<TeCoverageDimension>& dimensions)
    00402 {
    00403     TeQuerierParams querierParams(true, columns);
    00404     querierParams.setParams(srcLayer);
    00405     TeQuerier querier(querierParams);
    00406     querier.loadInstances();
    00407
    00408     // Set information about the coverage dimensions
    00409     TeAttributeList attList = querier.getAttrList();
    00410     attributeListToCoverageDimensions(attList, dimensions);
    00411
    00412     int dimensionsSize = TeCoverageDimensionsSize(dimensions);
    00413
    00414     // Extract coverage data
    00415     unsigned int instanceCount = 0;
    00416     TeSTInstance sti;
    00417     while(querier.fetchInstance(sti))
    00418     {
    00419         if(!sti.hasPolygons())
    00420         {
    00421             // If it doesn't have a polygon, proceed to the next instance
    00422             continue;
    00423         }
    00424
    00425         SerializedPair<TePolygon> serialized;
    00426
    00427         // Get only the first polygon
    00428         TePolygonSet polySet;
    00429         sti.getGeometry(polySet);
    00430         TePolygon poly = *(polySet.begin());
    00431
    00432         serialized.geom = poly;
    00433
    00434         // Count number of lines and points that make this polygon
    00435         unsigned int numLines = 0;
    00436         unsigned int numPoints = 0;
    00437         for(unsigned int i = 0; i < poly.size(); ++i)
    00438         {
    00439             numLines += 1;
    00440             numPoints += poly[i].size();
    00441         }
    00442
    00443         int coordSize = (2 * sizeof(double));
    00444         serialized.size = sizeof(unsigned int) + (numLines * sizeof(unsigned int)) + (numPoints * coordSize) + dimensionsSize;
    00445
    00446         serialized.data = (unsigned char*)malloc(serialized.size);
    00447
    00448         unsigned char* temp = serialized.data;
    00449
    00450         // Write Polygon serialization
    00451         WRITE(temp, unsigned int, numLines);
    00452         for (unsigned int i = 0; i < numLines; ++i)
    00453         {
    00454             TeLine2D line = poly[i];
    00455             WRITE(temp, unsigned int, line.size());
    00456
    00457             // Write point coordinates
    00458             for (unsigned int j = 0; j < line.size(); ++j)
    00459             {
    00460                 TePoint point = line[j];
    00461                 WRITE(temp, double, point.location().x());
    00462                 WRITE(temp, double, point.location().y());
    00463             }
    00464         }
    00465
    00466         // Write dimensions serialization
    00467         TePropertyVector vec = sti.getPropertyVector();
    00468         for(unsigned int i = 0; i < vec.size(); i++)
    00469         {
    00470             if (dimensions[i].type == TeINTEGER)
    00471             {
    00472                 std::stringstream buf;
    00473                 buf << vec[i].value_;
    00474                 int val;
    00475                 buf >> val;
    00476                 WRITE(temp, int, val);
    00477                 buf.clear();
    00478             }
    00479             else
    00480             {
    00481                 std::stringstream buf;
    00482                 buf << vec[i].value_;
    00483                 double val;
    00484                 buf >> val;
    00485                 WRITE(temp, double, val);
    00486                 buf.clear();
    00487             }
    00488         }
    00489         serializedVector.push_back(serialized);
    00490
    00491     }
    00492     return true;
    00493 }
    00494
    00496
    00507 template <class T>
    00508 bool
    00509 TeCoverageImportLayer(TeLayer* layer, TeLayer* srcLayer, const std::vector<std::string>& columns, const std::string& coverageId)
    00510 {
    00511     if (!layer || !srcLayer)
    00512     {
    00513         std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
    00514         throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
    00515     }
    00516
    00517     // Check if the layer has a coverage with the same coverage id
    00518     std::vector<std::string> coverageIds;
    00519     TeRetrieveCoverageIds(layer, coverageIds);
    00520     if (find(coverageIds.begin(), coverageIds.end(), coverageId) != coverageIds.end())
    00521     {
    00522         std::string errorMsg = "Couldn't import Coverage. Coverage ID already in use.";
    00523         throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
    00524     }
    00525
    00526     std::vector<SerializedPair<T> > serialized;
    00527     std::vector<TeCoverageDimension> dimensions;
    00528
    00529     // Get data (geometry-value pairs) and metadata (dimensions) from the source layer
    00530     if (!decodeLayer(srcLayer, columns, serialized, dimensions))
    00531     {
    00532         std::string errorMsg = "Couldn't import Coverage. Error decoding source layer.";
    00533         throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
    00534     }
    00535
    00536     // Set metadata table with dimensions information
    00537     std::string& metadataTableName = TeDefaultCoverageMetadataTable(layer);
    00538     fillCoverageMetadataTable(layer, metadataTableName, coverageId, dimensions);
    00539
    00540     // Partition geometries in clusters
    00541     std::vector<std::vector<SerializedPair<T> > > clusterGroups;
    00542     clusterSerialized<T>(serialized, clusterGroups);
    00543
    00544     // Add clusters to the database and update layer and representations info
    00545     populateDatabase<T>(layer, coverageId, clusterGroups);
    00546
    00547     return true;
    00548 }
    00549
    00551
    00561 template <class T>
    00562 TeLayer*
    00563 TeCoverageImportLayer(TeDatabase* database, const std::string& layerName, TeLayer* srcLayer, const std::vector<std::string>& columns, const std::string& coverageId)
    00564 {
    00565     if (!database || layerName.empty() || !srcLayer)
    00566     {
    00567         std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
    00568         throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
    00569     }
    00570
    00571     TeLayer* newLayer = createNewCoverageLayer(database, layerName, srcLayer->projection());
    00572     try {
    00573         TeCoverageImportLayer<T>(newLayer, srcLayer, columns, coverageId);
    00574     }
    00575     catch (TeException e)
    00576     {
    00577                database->deleteLayer(newLayer->id());
    00578         throw e;
    00579     }
    00580
    00581            return newLayer;
    00582 }
    00583
    00585
    00597 //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");
    00598
    00600
    00609 //bool TePointCoverageImportSHP(TeLayer* layer, const std::string& fileName, const std::vector<std::string>& columns, const std::string& coverageId = "0");
    00610
    00611
    00612 /*
    00613 bool
    00614 TePointCoverageImportSHP(TeLayer* layer, const std::string& fileName, const std::vector<std::string>& columns, const std::string& coverageId)
    00615 {
    00616     if (!layer || fileName.empty())
    00617     {
    00618         std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
    00619         throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
    00620     }
    00621
    00622     // Check if the layer has a coverage with the same coverage id
    00623     std::vector<std::string> coverageIds;
    00624     TeRetrieveCoverageIds(layer, coverageIds);
    00625     if (find(coverageIds.begin(), coverageIds.end(), coverageId) != coverageIds.end())
    00626     {
    00627         std::string errorMsg = "Couldn't import Point Coverage. Coverage ID already in use.";
    00628         throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
    00629     }
    00630
    00631     SerializedPointVector serializedPoints;
    00632     std::vector<TeCoverageDimension> dimensions;
    00633
    00634     // Get data (point-value pairs) and metadata (dimensions) from a ShapeFile
    00635     if (!decodeSHPFile(fileName, columns, serializedPoints, dimensions))
    00636     {
    00637         std::string errorMsg = "Couldn't import Point Coverage. Error decoding Shape File.";
    00638         throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
    00639     }
    00640
    00641     // Set metadata table with dimensions information
    00642     std::string& metadataTableName = TeDefaultCoverageMetadataTable(layer);
    00643     fillCoverageMetadataTable(layer, metadataTableName, coverageId, dimensions);
    00644
    00645     // Partition points in clusters
    00646     std::vector<SerializedPointVector> clusterGroups;
    00647     clusterSerializedPoints(serializedPoints, clusterGroups);
    00648
    00649     // Add clusters to the database and update layer and representations info
    00650     populateDatabase(layer, coverageId, clusterGroups);
    00651
    00652     return true;
    00653 }
    00654
    00655 TeLayer*
    00656 TePointCoverageImportSHP(TeDatabase* database, const std::string& layerName, TeProjection* projection, const std::string& fileName, const std::vector<std::string>& columns, const std::string& coverageId)
    00657 {
    00658     if (!database || !projection || layerName.empty() || fileName.empty())
    00659     {
    00660         std::string errorMsg = "Couldn't import Point Coverage. Illegal parameters.";
    00661         throw TeException(UNKNOWN_ERROR_TYPE, errorMsg, false);
    00662     }
    00663
    00664     TeLayer* newLayer = createNewCoverageLayer(database, layerName, projection);
    00665     try {
    00666         TePointCoverageImportSHP(newLayer, fileName, columns, coverageId);
    00667     }
    00668     catch (TeException e)
    00669     {
    00670                database->deleteLayer(newLayer->id());
    00671         throw e;
    00672     }
    00673
    00674            return newLayer;
    00675 }
    00676 */
    00677
    00678 #endif // __TERRALIB_INTERNAL_COVERAGEIMPORT_H

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines