TePDIRaster2Vector_test.cpp

Shows how to use this class.

00001 #define TEAGN_ENABLE_STDOUT_LOG
00002 
00003 #include <TePDIExamplesBase.hpp>
00004 
00005 #include <TePDIParameters.hpp>
00006 #include <TeAgnostic.h>
00007 #include <TePDIUtils.hpp>
00008 #include <TePDIRaster2Vector.hpp>
00009 #include <TeInitRasterDecoders.h>
00010 
00011 #include <TeProgress.h>
00012 #include <TeStdIOProgress.h>
00013 
00014 #include <shapefil.h> // Needed by exportPS2SHP
00015 
00016 bool exportPS2SHP( const TePolygonSet& ps, 
00017     const std::string& base_file_name  )
00018 {
00019     // creating files names
00020     std::string dbfFilename = base_file_name + ".dbf";
00021     std::string shpFilename = base_file_name + ".shp";
00022 
00023     // creating polygons attribute list ( max attribute size == 12 )
00024     TeAttributeList attList;
00025     
00026     TeAttribute at;
00027     at.rep_.type_ = TeSTRING;               //the id of the cell
00028     at.rep_.numChar_ = 10;
00029     at.rep_.name_ = "object_id_";
00030     at.rep_.isPrimaryKey_ = true;
00031     
00032     attList.push_back(at);
00033     
00034     /* DBF output file handle creation */
00035 
00036     DBFHandle hDBF = DBFCreate( dbfFilename.c_str() );
00037     TEAGN_TRUE_OR_RETURN( ( hDBF != 0 ), "DBF file creation error" );
00038     
00039     /* Writing attributes */
00040 
00041     TeAttributeList::iterator it=attList.begin();
00042     while ( it != attList.end() )
00043     {
00044       TeAttribute at = (*it);
00045       string atName = at.rep_.name_;
00046 
00047       // *OBS****atributos podem ter no maximo 12 caracteres
00048       // max attribute size == 12
00049       if (at.rep_.type_ == TeSTRING )
00050       {
00051         TEAGN_TRUE_OR_THROW( 
00052           ( DBFAddField( hDBF, atName.c_str(), FTString, at.rep_.numChar_, 0 ) 
00053            != -1 ), "Error writing TeSTRING attribute" );
00054       }
00055       else if (at.rep_.type_ == TeINT)
00056       {
00057         TEAGN_TRUE_OR_THROW( 
00058           ( DBFAddField( hDBF, atName.c_str(), FTInteger, 10, 0 ) != -1 ), 
00059           "Error writing TeINT attribute" );
00060       }
00061       else if (at.rep_.type_ == TeREAL)
00062       {
00063         TEAGN_TRUE_OR_THROW( 
00064           ( DBFAddField( hDBF, atName.c_str(), FTDouble, 10, 5 ) != -1 ), 
00065           "Error writing TeREAL attribute" );
00066           
00067       }
00068       else if (at.rep_.type_ == TeDATETIME)
00069       {
00070         TEAGN_TRUE_OR_THROW( 
00071           ( DBFAddField( hDBF, atName.c_str(), FTDate, 8, 0 ) != -1 ), 
00072           "Error writing TeDATETIME attribute" );
00073       }
00074                 
00075       ++it;
00076     }
00077     
00078     /* SHP output file handle creation */
00079 
00080     SHPHandle hSHP = SHPCreate( shpFilename.c_str(), SHPT_POLYGON );
00081     if( hSHP == 0 ) {
00082       TEAGN_LOGERR( "DBF file creation error" );
00083       DBFClose( hDBF );
00084       return false;
00085     }
00086     
00087     /* Writing polygons */
00088 
00089     int iRecord = 0;
00090     int totpoints = 0;
00091     double  *padfX, *padfY;
00092     SHPObject       *psObject;
00093     int posXY, npoints, nelem;
00094     int nVertices;
00095     int* panParts;
00096 
00097     TePolygonSet::iterator itps;
00098     TePolygon poly;
00099 
00100     for (itps = ps.begin() ; itps != ps.end() ; itps++ ) {
00101       poly=(*itps);
00102       totpoints = 0;
00103       nVertices = poly.size();
00104       for (unsigned int n=0; n<poly.size();n++) {
00105         totpoints += poly[n].size();
00106       }
00107 
00108       panParts = (int *) malloc(sizeof(int) * nVertices);
00109       padfX = (double *) malloc(sizeof(double) * totpoints);
00110       padfY = (double *) malloc(sizeof(double) * totpoints);
00111       posXY = 0;
00112       nelem = 0;
00113       
00114       for (unsigned int l=0; l<poly.size(); ++l) {
00115         if (l==0) {
00116           if (TeOrientation(poly[l]) == TeCOUNTERCLOCKWISE) {
00117             TeReverseLine(poly[l]);
00118           }
00119         } else {
00120           if (TeOrientation(poly[l]) == TeCLOCKWISE) {
00121             TeReverseLine(poly[l]);
00122           }
00123         }
00124         
00125         npoints = poly[l].size();
00126         panParts[nelem]=posXY;
00127         
00128         for (int m=0; m<npoints; m++ ) {
00129           padfX[posXY] = poly[l][m].x_;
00130           padfY[posXY] = poly[l][m].y_;
00131           posXY++;
00132         }
00133         
00134         nelem++;
00135       }
00136                 
00137       psObject = SHPCreateObject( SHPT_POLYGON, -1, nelem, panParts, NULL,
00138         posXY, padfX, padfY, NULL, NULL );
00139         
00140       int shpRes = SHPWriteObject( hSHP, -1, psObject );
00141       TEAGN_TRUE_OR_THROW( ( shpRes != -1 ), 
00142         "Unable to create a shape write object" )
00143         
00144       SHPDestroyObject( psObject );
00145       free( panParts );
00146       free( padfX );
00147       free( padfY );
00148 
00149       // writing attributes - same creation order
00150       for (unsigned int j=0; j<attList.size();j++) {
00151         if ( attList[j].rep_.type_ == TeSTRING ) {
00152           DBFWriteStringAttribute(hDBF, iRecord, j, poly.objectId().c_str() );
00153         } /*else if ( attList[j].rep_.type_ == TeINT) {
00154           DBFWriteIntegerAttribute(hDBF, iRecord, j,  VALOR INT );        
00155         } else if ( attList[j].rep_.type_ == TeREAL) {
00156           DBFWriteDoubleAttribute(hDBF, iRecord, j,  VALOR DOUBLE);
00157         } else if ( attList[j].rep_.type_ == TeDATETIME) {
00158           TeTime time =  VALOR DATA;
00159           char dd[8];
00160           sprintf(dd,"%04d%02d%02d",time.year(),time.month(),time.day());
00161           DBFWriteDateAttribute(hDBF, iRecord, j, dd );
00162         }*/
00163       }
00164                 
00165       iRecord++;
00166     }
00167         
00168     DBFClose( hDBF );
00169     SHPClose( hSHP );
00170 
00171     return true;  
00172 }
00173 
00174 TePDITypes::TePDIRasterPtrType generateTestRaster()
00175 {
00176   TeRasterParams RAMRaster_params;
00177   RAMRaster_params.nBands( 1 );
00178   RAMRaster_params.setDataType( TeUNSIGNEDLONG );
00179   RAMRaster_params.setDummy( 0, -1 );
00180   RAMRaster_params.setNLinesNColumns( 100, 100 );
00181   
00182   TePDITypes::TePDIRasterPtrType RAMRaster;
00183   TEAGN_TRUE_OR_THROW( TePDIUtils::TeAllocRAMRaster( RAMRaster,
00184     RAMRaster_params, false ), "RAM Raster Alloc error" );
00185     
00186   int line = 0;
00187   int col = 0;
00188   
00189   /* Area 1 */
00190     
00191   for( line = 10 ; line < 20; ++line ) {
00192     for( col = 10 ; col < 20 ; ++col ) {
00193       TEAGN_TRUE_OR_THROW( 
00194         RAMRaster->setElement( col, line, 10.0, 0 ), "Raster fill error" );
00195     }
00196   }
00197   
00198   /* Area 1 dummy hole */
00199     
00200   for( line = 13 ; line < 18; ++line ) {
00201     for( col = 13 ; col < 18 ; ++col ) {
00202       TEAGN_TRUE_OR_THROW( 
00203         RAMRaster->setElement( col, line, 0.0, 0 ), "Raster fill error" );
00204     }
00205   }  
00206   
00207   /* Area 2 */
00208   
00209   for( line = 10 ; line < 20; ++line ) {
00210     for( col = 30 ; col < 40 ; ++col ) {
00211       TEAGN_TRUE_OR_THROW( 
00212         RAMRaster->setElement( col, line, 20.0, 0 ), "Raster fill error" );
00213     }
00214   }  
00215   
00216   /* Area 2 hole */
00217     
00218   for( line = 13 ; line < 18; ++line ) {
00219     for( col = 33 ; col < 38 ; ++col ) {
00220       TEAGN_TRUE_OR_THROW( 
00221         RAMRaster->setElement( col, line, 10.0, 0 ), "Raster fill error" );
00222     }
00223   }  
00224   
00225   /* Area 3 */
00226   
00227   for( line = 10 ; line < 20; ++line ) {
00228     for( col = 50 ; col < 60 ; ++col ) {
00229       TEAGN_TRUE_OR_THROW( 
00230         RAMRaster->setElement( col, line, 30.0, 0 ), "Raster fill error" );
00231     }
00232   } 
00233   
00234   /* Area 4 */
00235   
00236   for( line = 0 ; line < 9; ++line ) {
00237     for( col = 70 ; col < 100 ; ++col ) {
00238       TEAGN_TRUE_OR_THROW( 
00239         RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
00240     }
00241   } 
00242   
00243   for( line = 0 ; line < 40; ++line ) {
00244     for( col = 90 ; col < 100 ; ++col ) {
00245       TEAGN_TRUE_OR_THROW( 
00246         RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
00247     }
00248   } 
00249   
00250   for( line = 30 ; line < 40; ++line ) {
00251     for( col = 70 ; col < 100 ; ++col ) {
00252       TEAGN_TRUE_OR_THROW( 
00253         RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
00254     }
00255   } 
00256   
00257   for( line = 20 ; line < 30; ++line ) {
00258     for( col = 70 ; col < 80 ; ++col ) {
00259       TEAGN_TRUE_OR_THROW( 
00260         RAMRaster->setElement( col, line, 40.0, 0 ), "Raster fill error" );
00261     }
00262   }   
00263   
00264   /* Area 5 */
00265   
00266   for( line = 50 ; line < 90; ++line ) {
00267     for( col = 10 ; col < 90 ; ++col ) {
00268       TEAGN_TRUE_OR_THROW( 
00269         RAMRaster->setElement( col, line, 50.0, 0 ), "Raster fill error" );
00270     }
00271   }
00272   
00273   /* Area 6 */
00274     
00275   for( line = 60 ; line < 70; ++line ) {
00276     for( col = 20 ; col < 30 ; ++col ) {
00277       TEAGN_TRUE_OR_THROW( 
00278         RAMRaster->setElement( col, line, 10.0, 0 ), "Raster fill error" );
00279     }
00280   }    
00281   
00282   /* Area 7 */
00283     
00284   for( line = 60 ; line < 70; ++line ) {
00285     for( col = 40 ; col < 50 ; ++col ) {
00286       TEAGN_TRUE_OR_THROW( 
00287         RAMRaster->setElement( col, line, 20.0, 0 ), "Raster fill error" );
00288     }
00289   }    
00290 
00291   /* Area 8 */
00292     
00293   for( line = 60 ; line < 70; ++line ) {
00294     for( col = 60 ; col < 70 ; ++col ) {
00295       TEAGN_TRUE_OR_THROW( 
00296         RAMRaster->setElement( col, line, 30.0, 0 ), "Raster fill error" );
00297     }
00298   }    
00299 
00300   /* Area 9 */
00301     
00302   for( line = 70 ; line < 80; ++line ) {
00303     for( col = 20 ; col < 70 ; ++col ) {
00304       TEAGN_TRUE_OR_THROW( 
00305         RAMRaster->setElement( col, line, 0.0, 0 ), "Raster fill error" );
00306     }
00307   }  
00308   
00309   /* Area 10 */
00310     
00311   for( line = 95 ; line < 100; ++line ) {
00312     for( col = 95 ; col < 100 ; ++col ) {
00313       TEAGN_TRUE_OR_THROW( 
00314         RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
00315     }
00316   }     
00317   
00318   /* Area 11 */
00319     
00320   for( line = 0 ; line < 5; ++line ) {
00321     for( col = 0 ; col < 5 ; ++col ) {
00322       TEAGN_TRUE_OR_THROW( 
00323         RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
00324     }
00325   }  
00326   
00327   /* Area 12 */
00328     
00329   for( line = 95 ; line < 100; ++line ) {
00330     for( col = 0 ; col < 5 ; ++col ) {
00331       TEAGN_TRUE_OR_THROW( 
00332         RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
00333     }
00334   }      
00335   
00336   /* Area 13 */
00337     
00338   for( line = 40 ; line < 43; ++line ) {
00339     for( col = 10 ; col < 13 ; ++col ) {
00340       TEAGN_TRUE_OR_THROW( 
00341         RAMRaster->setElement( col, line, 60.0, 0 ), "Raster fill error" );
00342     }
00343   }   
00344   
00345   TEAGN_TRUE_OR_THROW( 
00346     RAMRaster->setElement( 11, 39, 60.0, 0 ), "Raster fill error" );   
00347   TEAGN_TRUE_OR_THROW( 
00348     RAMRaster->setElement( 13, 41, 60.0, 0 ), "Raster fill error" );   
00349   TEAGN_TRUE_OR_THROW( 
00350     RAMRaster->setElement( 11, 43, 60.0, 0 ), "Raster fill error" );   
00351   TEAGN_TRUE_OR_THROW( 
00352     RAMRaster->setElement( 9, 41, 60.0, 0 ), "Raster fill error" );   
00353     
00354   /* Area 14 */
00355     
00356   TEAGN_TRUE_OR_THROW( 
00357     RAMRaster->setElement( 31, 39, 60.0, 0 ), "Raster fill error" );   
00358   TEAGN_TRUE_OR_THROW( 
00359     RAMRaster->setElement( 31, 40, 60.0, 0 ), "Raster fill error" );   
00360   TEAGN_TRUE_OR_THROW( 
00361     RAMRaster->setElement( 31, 41, 60.0, 0 ), "Raster fill error" );   
00362   TEAGN_TRUE_OR_THROW( 
00363     RAMRaster->setElement( 31, 42, 60.0, 0 ), "Raster fill error" );   
00364   TEAGN_TRUE_OR_THROW( 
00365     RAMRaster->setElement( 31, 43, 60.0, 0 ), "Raster fill error" );   
00366 
00367   TEAGN_TRUE_OR_THROW( 
00368     RAMRaster->setElement( 29, 41, 60.0, 0 ), "Raster fill error" );   
00369   TEAGN_TRUE_OR_THROW( 
00370     RAMRaster->setElement( 30, 41, 60.0, 0 ), "Raster fill error" );   
00371   TEAGN_TRUE_OR_THROW( 
00372     RAMRaster->setElement( 31, 41, 60.0, 0 ), "Raster fill error" );   
00373   TEAGN_TRUE_OR_THROW( 
00374     RAMRaster->setElement( 32, 41, 60.0, 0 ), "Raster fill error" );   
00375   TEAGN_TRUE_OR_THROW( 
00376     RAMRaster->setElement( 33, 41, 60.0, 0 ), "Raster fill error" );   
00377         
00378   /* Area 15 */
00379   
00380   TEAGN_TRUE_OR_THROW( 
00381     RAMRaster->setElement( 42, 39, 60.0, 0 ), "Raster fill error" );  
00382   TEAGN_TRUE_OR_THROW( 
00383     RAMRaster->setElement( 46, 39, 60.0, 0 ), "Raster fill error" );  
00384     
00385   TEAGN_TRUE_OR_THROW( 
00386     RAMRaster->setElement( 43, 40, 60.0, 0 ), "Raster fill error" );
00387   TEAGN_TRUE_OR_THROW( 
00388     RAMRaster->setElement( 45, 40, 60.0, 0 ), "Raster fill error" );
00389     
00390   TEAGN_TRUE_OR_THROW( 
00391     RAMRaster->setElement( 44, 41, 60.0, 0 ), "Raster fill error" );
00392     
00393   TEAGN_TRUE_OR_THROW( 
00394     RAMRaster->setElement( 43, 42, 60.0, 0 ), "Raster fill error" );
00395   TEAGN_TRUE_OR_THROW( 
00396     RAMRaster->setElement( 45, 42, 60.0, 0 ), "Raster fill error" );
00397     
00398   TEAGN_TRUE_OR_THROW( 
00399     RAMRaster->setElement( 42, 43, 60.0, 0 ), "Raster fill error" );
00400   TEAGN_TRUE_OR_THROW( 
00401     RAMRaster->setElement( 46, 43, 60.0, 0 ), "Raster fill error" );
00402     
00403   /* Area 16 */
00404     
00405   TEAGN_TRUE_OR_THROW( 
00406     RAMRaster->setElement( 55, 39, 60.0, 0 ), "Raster fill error" );  
00407   TEAGN_TRUE_OR_THROW( 
00408     RAMRaster->setElement( 56, 40, 60.0, 0 ), "Raster fill error" );      
00409   TEAGN_TRUE_OR_THROW( 
00410     RAMRaster->setElement( 57, 41, 60.0, 0 ), "Raster fill error" );      
00411   TEAGN_TRUE_OR_THROW( 
00412     RAMRaster->setElement( 58, 42, 60.0, 0 ), "Raster fill error" );      
00413   TEAGN_TRUE_OR_THROW( 
00414     RAMRaster->setElement( 59, 43, 60.0, 0 ), "Raster fill error" );      
00415     
00416   /* Area 17 */
00417     
00418   TEAGN_TRUE_OR_THROW( 
00419     RAMRaster->setElement( 10, 30, 60.0, 0 ), "Raster fill error" ); 
00420   TEAGN_TRUE_OR_THROW( 
00421     RAMRaster->setElement( 11, 29, 60.0, 0 ), "Raster fill error" ); 
00422   TEAGN_TRUE_OR_THROW( 
00423     RAMRaster->setElement( 12, 28, 60.0, 0 ), "Raster fill error" ); 
00424   TEAGN_TRUE_OR_THROW( 
00425     RAMRaster->setElement( 13, 27, 60.0, 0 ), "Raster fill error" ); 
00426   TEAGN_TRUE_OR_THROW( 
00427     RAMRaster->setElement( 14, 26, 60.0, 0 ), "Raster fill error" );     
00428     
00429   /* Area 18 */
00430     
00431   TEAGN_TRUE_OR_THROW( 
00432     RAMRaster->setElement( 10, 2, 60.0, 0 ), "Raster fill error" ); 
00433   TEAGN_TRUE_OR_THROW( 
00434     RAMRaster->setElement( 11, 2, 60.0, 0 ), "Raster fill error" ); 
00435   TEAGN_TRUE_OR_THROW( 
00436     RAMRaster->setElement( 9, 3, 60.0, 0 ), "Raster fill error" ); 
00437   TEAGN_TRUE_OR_THROW( 
00438     RAMRaster->setElement( 10, 3, 60.0, 0 ), "Raster fill error" ); 
00439 
00440   /* Area 19 */
00441     
00442   TEAGN_TRUE_OR_THROW( 
00443     RAMRaster->setElement( 15, 2, 60.0, 0 ), "Raster fill error" ); 
00444   TEAGN_TRUE_OR_THROW( 
00445     RAMRaster->setElement( 16, 2, 60.0, 0 ), "Raster fill error" ); 
00446   TEAGN_TRUE_OR_THROW( 
00447     RAMRaster->setElement( 16, 3, 60.0, 0 ), "Raster fill error" ); 
00448   TEAGN_TRUE_OR_THROW( 
00449     RAMRaster->setElement( 17, 3, 60.0, 0 ), "Raster fill error" ); 
00450     
00451   /* Area 20 */
00452     
00453   TEAGN_TRUE_OR_THROW( 
00454     RAMRaster->setElement( 20, 2, 60.0, 0 ), "Raster fill error" ); 
00455   TEAGN_TRUE_OR_THROW( 
00456     RAMRaster->setElement( 20, 3, 60.0, 0 ), "Raster fill error" ); 
00457   TEAGN_TRUE_OR_THROW( 
00458     RAMRaster->setElement( 21, 3, 60.0, 0 ), "Raster fill error" ); 
00459   TEAGN_TRUE_OR_THROW( 
00460     RAMRaster->setElement( 21, 4, 60.0, 0 ), "Raster fill error" );    
00461     
00462   /* Area 20 */
00463     
00464   TEAGN_TRUE_OR_THROW( 
00465     RAMRaster->setElement( 25, 3, 60.0, 0 ), "Raster fill error" ); 
00466   TEAGN_TRUE_OR_THROW( 
00467     RAMRaster->setElement( 25, 4, 60.0, 0 ), "Raster fill error" ); 
00468   TEAGN_TRUE_OR_THROW( 
00469     RAMRaster->setElement( 26, 3, 60.0, 0 ), "Raster fill error" ); 
00470   TEAGN_TRUE_OR_THROW( 
00471     RAMRaster->setElement( 26, 2, 60.0, 0 ), "Raster fill error" );     
00472     
00473                       
00474   /* Line 1 */
00475     
00476   for( line = 35 ; line < 55; ++line ) {
00477     TEAGN_TRUE_OR_THROW( 
00478       RAMRaster->setElement( 85, line, 200.0, 0 ), "Raster fill error" );
00479   } 
00480   
00481   /* Line 2 */
00482     
00483   for( col = 25 ; col < 45; ++col ) {
00484     TEAGN_TRUE_OR_THROW( 
00485       RAMRaster->setElement( col, 65, 10.0, 0 ), "Raster fill error" );
00486   }      
00487   
00488   /* Points */
00489 
00490   TEAGN_TRUE_OR_THROW( 
00491     RAMRaster->setElement( 55, 15, 250.0, 0 ), "Raster fill error" );  
00492     
00493   TEAGN_TRUE_OR_THROW( 
00494     RAMRaster->setElement( 55, 5, 251.0, 0 ), "Raster fill error" );      
00495     
00496   TEAGN_TRUE_OR_THROW( 
00497     RAMRaster->setElement( 15, 15, 251.0, 0 ), "Raster fill error" );     
00498 
00499   TEAGN_TRUE_OR_THROW( 
00500     RAMRaster->setElement( 35, 15, 0, 0 ), "Raster fill error" );     
00501       
00502   return RAMRaster; 
00503 }
00504 
00505 
00506 void Raster2Vector_test()
00507 {
00508   TePDITypes::TePDIRasterPtrType RAMRaster = generateTestRaster();
00509   
00510   TEAGN_TRUE_OR_THROW( TePDIUtils::TeRaster2Geotiff( RAMRaster,
00511     TEPDIEXAMPLESBINPATH "Raster2Vector_test.tif" ), "GeoTIF generation error" );
00512     
00513   TePDITypes::TePDIPolSetMapPtrType output_polsets( 
00514     new TePDITypes::TePDIPolSetMapType );
00515 
00516   TePDIParameters params2;
00517   params2.SetParameter( "rotulated_image", RAMRaster );
00518   params2.SetParameter( "channel", (unsigned int)0 );
00519   params2.SetParameter( "output_polsets", output_polsets );
00520   params2.SetParameter( "max_pols", (unsigned long int)200 );
00521   
00522   TePDIRaster2Vector raster2Vector;  
00523 
00524   TEAGN_TRUE_OR_THROW( raster2Vector.Reset( params2 ),
00525     "Invalid Parameters for raster2Vector" );
00526 
00527   TEAGN_TRUE_OR_THROW( raster2Vector.Apply(),
00528     "Apply error" );
00529     
00530   TePDITypes::TePDIPolSetMapType::iterator it = output_polsets->begin();
00531   TePDITypes::TePDIPolSetMapType::iterator it_end = output_polsets->end();
00532   
00533   unsigned int pols_number = 0;
00534     
00535   while( it != it_end ) {
00536     TEAGN_TRUE_OR_THROW( exportPS2SHP( it->second, TEPDIEXAMPLESBINPATH "Raster2Vector_test_ps" +
00537       Te2String( (int)it->first ) ),  "Polygonset export error" )
00538       
00539     pols_number += it->second.size();
00540       
00541     ++it;
00542   }
00543   
00544   TEAGN_CHECK_EPS( output_polsets->size(), 9, 0.0,
00545     "Invalid generated polygon set size" );
00546   TEAGN_CHECK_EPS( pols_number, 41, 0.0,
00547     "Invalid generated polygon set size" );
00548     
00549 }
00550 
00551 int main()
00552 {
00553   TEAGN_LOGMSG( "Test started." );
00554 
00555   try{
00556     TeStdIOProgress pi;
00557     TeProgress::setProgressInterf( dynamic_cast< TeProgressBase* >( &pi ) );  
00558   
00559     TeInitRasterDecoders();
00560 
00561     Raster2Vector_test();
00562   }
00563   catch( const TeException& e ){
00564     TEAGN_LOGERR( "Test Failed - " + e.message() );
00565     return EXIT_FAILURE;
00566   }
00567 
00568   TEAGN_LOGMSG( "Test OK." );
00569   return EXIT_SUCCESS;
00570 }

Generated on Sun Jul 29 04:01:03 2012 for TerraLib - Development Source by  doxygen 1.5.3