00001 /****************************************************************************** 00002 * $Id: gdaldataset_cpp-source.html,v 1.13 2002/12/21 19:13:12 warmerda Exp $ 00003 * 00004 * Project: GDAL Core 00005 * Purpose: Base class for raster file formats. 00006 * Author: Frank Warmerdam, warmerda@home.com 00007 * 00008 ****************************************************************************** 00009 * Copyright (c) 1998, 2000, Frank Warmerdam 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining a 00012 * copy of this software and associated documentation files (the "Software"), 00013 * to deal in the Software without restriction, including without limitation 00014 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00015 * and/or sell copies of the Software, and to permit persons to whom the 00016 * Software is furnished to do so, subject to the following conditions: 00017 * 00018 * The above copyright notice and this permission notice shall be included 00019 * in all copies or substantial portions of the Software. 00020 * 00021 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00022 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00023 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00024 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00025 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00026 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 00027 * DEALINGS IN THE SOFTWARE. 00028 ****************************************************************************** 00029 * 00030 * $Log: gdaldataset_cpp-source.html,v $ 00030 * Revision 1.13 2002/12/21 19:13:12 warmerda 00030 * updated 00030 * 00031 * Revision 1.30 2002/12/18 15:17:05 warmerda 00032 * added errors in some unimplemented methods 00033 * 00034 * Revision 1.29 2002/09/06 01:29:55 warmerda 00035 * added C entry points for GetAccess() and GetOpenDatasets() 00036 * 00037 * Revision 1.28 2002/07/09 20:33:12 warmerda 00038 * expand tabs 00039 * 00040 * Revision 1.27 2002/05/28 18:56:22 warmerda 00041 * added shared dataset concept 00042 * 00043 * Revision 1.26 2001/11/16 21:36:01 warmerda 00044 * added the AddBand() method on GDALDataset 00045 * 00046 * Revision 1.25 2001/10/18 14:35:22 warmerda 00047 * avoid conflicts between parameters and member data 00048 * 00049 * Revision 1.24 2001/10/17 21:47:02 warmerda 00050 * added SetGCPs() on GDALDataset 00051 * 00052 * Revision 1.23 2001/07/18 04:04:30 warmerda 00053 * added CPL_CVSID 00054 * 00055 * Revision 1.22 2001/01/10 22:24:37 warmerda 00056 * Patched GDALDataset::FlushCache() to recover gracefully if papoBands 00057 * doesn't exist yet matching nBands. 00058 * 00059 * Revision 1.21 2000/10/06 15:27:13 warmerda 00060 * default bands to same access as dataset in SetBand() 00061 * 00062 * Revision 1.20 2000/08/09 16:26:00 warmerda 00063 * debug message on dataset cleanup 00064 * 00065 * Revision 1.19 2000/07/11 14:35:43 warmerda 00066 * added documentation 00067 * 00068 * Revision 1.18 2000/06/27 16:46:56 warmerda 00069 * default to using dummy progress func 00070 * 00071 * Revision 1.17 2000/06/26 21:44:50 warmerda 00072 * make progress func save for overviews 00073 * 00074 * Revision 1.16 2000/06/26 18:47:31 warmerda 00075 * added GDALBuildOverviews 00076 * 00077 * Revision 1.15 2000/04/21 21:56:23 warmerda 00078 * move metadata to GDALMajorObject, added BuildOverviews 00079 * 00080 * Revision 1.14 2000/03/31 13:42:06 warmerda 00081 * added gcp support methods 00082 * 00083 * Revision 1.13 2000/03/23 16:53:55 warmerda 00084 * default geotransform is 0,1,0,0,0,1 00085 * 00086 * Revision 1.12 2000/03/06 21:50:10 warmerda 00087 * fixed bug with setting nBands 00088 * 00089 * Revision 1.11 2000/03/06 02:20:56 warmerda 00090 * added reference counting 00091 * 00092 * Revision 1.10 2000/02/28 16:34:49 warmerda 00093 * set the nRasterX/YSize in bands 00094 * 00095 * Revision 1.9 1999/11/11 21:59:07 warmerda 00096 * added GetDriver() for datasets 00097 * 00098 * Revision 1.8 1999/10/01 14:44:02 warmerda 00099 * added documentation 00100 * 00101 * Revision 1.7 1999/05/17 01:43:10 warmerda 00102 * fixed GDALSetGeoTransform() 00103 * 00104 * Revision 1.6 1999/05/16 20:04:58 warmerda 00105 * Don't emit an error message when SetProjection() is called for datasets 00106 * that don't implement the call. 00107 * 00108 * Revision 1.5 1999/04/21 04:16:51 warmerda 00109 * experimental docs 00110 * 00111 * Revision 1.4 1999/01/11 15:37:55 warmerda 00112 * fixed log keyword 00113 */ 00114 00115 #include "gdal_priv.h" 00116 #include "cpl_string.h" 00117 00118 CPL_CVSID("$Id: gdaldataset_cpp-source.html,v 1.13 2002/12/21 19:13:12 warmerda Exp $"); 00119 00120 static int nGDALDatasetCount = 0; 00121 static GDALDataset **papoGDALDatasetList = NULL; 00122 00123 /************************************************************************/ 00124 /* GDALDataset() */ 00125 /************************************************************************/ 00126 00127 GDALDataset::GDALDataset() 00128 00129 { 00130 poDriver = NULL; 00131 eAccess = GA_ReadOnly; 00132 nRasterXSize = 512; 00133 nRasterYSize = 512; 00134 nBands = 0; 00135 papoBands = NULL; 00136 nRefCount = 1; 00137 bShared = FALSE; 00138 00139 /* -------------------------------------------------------------------- */ 00140 /* Add this dataset to the open dataset list. */ 00141 /* -------------------------------------------------------------------- */ 00142 nGDALDatasetCount++; 00143 papoGDALDatasetList = (GDALDataset **) 00144 CPLRealloc( papoGDALDatasetList, sizeof(void *) * nGDALDatasetCount ); 00145 papoGDALDatasetList[nGDALDatasetCount-1] = this; 00146 } 00147 00148 /************************************************************************/ 00149 /* ~GDALDataset() */ 00150 /************************************************************************/ 00151 00163 GDALDataset::~GDALDataset() 00164 00165 { 00166 int i; 00167 00168 CPLDebug( "GDAL", "GDALClose(%s)\n", GetDescription() ); 00169 00170 /* -------------------------------------------------------------------- */ 00171 /* Remove dataset from the "open" dataset list. */ 00172 /* -------------------------------------------------------------------- */ 00173 for( i = 0; i < nGDALDatasetCount; i++ ) 00174 { 00175 if( papoGDALDatasetList[i] == this ) 00176 { 00177 papoGDALDatasetList[i] = papoGDALDatasetList[nGDALDatasetCount-1]; 00178 nGDALDatasetCount--; 00179 if( nGDALDatasetCount == 0 ) 00180 { 00181 CPLFree( papoGDALDatasetList ); 00182 papoGDALDatasetList = NULL; 00183 } 00184 break; 00185 } 00186 } 00187 00188 /* -------------------------------------------------------------------- */ 00189 /* Destroy the raster bands if they exist. */ 00190 /* -------------------------------------------------------------------- */ 00191 for( i = 0; i < nBands && papoBands != NULL; i++ ) 00192 { 00193 if( papoBands[i] != NULL ) 00194 delete papoBands[i]; 00195 } 00196 00197 CPLFree( papoBands ); 00198 } 00199 00200 /************************************************************************/ 00201 /* FlushCache() */ 00202 /************************************************************************/ 00203 00211 void GDALDataset::FlushCache() 00212 00213 { 00214 int i; 00215 00216 // This sometimes happens if a dataset is destroyed before completely 00217 // built. 00218 00219 if( papoBands == NULL ) 00220 return; 00221 00222 for( i = 0; i < nBands; i++ ) 00223 { 00224 if( papoBands[i] != NULL ) 00225 papoBands[i]->FlushCache(); 00226 } 00227 } 00228 00229 /************************************************************************/ 00230 /* RasterInitialize() */ 00231 /* */ 00232 /* Initialize raster size */ 00233 /************************************************************************/ 00234 00235 void GDALDataset::RasterInitialize( int nXSize, int nYSize ) 00236 00237 { 00238 CPLAssert( nXSize > 0 && nYSize > 0 ); 00239 00240 nRasterXSize = nXSize; 00241 nRasterYSize = nYSize; 00242 } 00243 00244 /************************************************************************/ 00245 /* AddBand() */ 00246 /************************************************************************/ 00247 00267 CPLErr GDALDataset::AddBand( GDALDataType eType, char **papszOptions ) 00268 00269 { 00270 CPLError( CE_Failure, CPLE_NotSupported, 00271 "Dataset does not support the AddBand() method." ); 00272 00273 return CE_Failure; 00274 } 00275 00276 /************************************************************************/ 00277 /* GDALAddBand() */ 00278 /************************************************************************/ 00279 00280 CPLErr GDALAddBand( GDALDatasetH hDataset, 00281 GDALDataType eType, char **papszOptions ) 00282 00283 { 00284 return ((GDALDataset *) hDataset)->AddBand( eType, papszOptions ); 00285 } 00286 00287 /************************************************************************/ 00288 /* SetBand() */ 00289 /* */ 00290 /* Set a band in the band array, updating the band count, and */ 00291 /* array size appropriately. */ 00292 /************************************************************************/ 00293 00294 void GDALDataset::SetBand( int nNewBand, GDALRasterBand * poBand ) 00295 00296 { 00297 /* -------------------------------------------------------------------- */ 00298 /* Do we need to grow the bands list? */ 00299 /* -------------------------------------------------------------------- */ 00300 if( nBands < nNewBand || papoBands == NULL ) { 00301 int i; 00302 00303 if( papoBands == NULL ) 00304 papoBands = (GDALRasterBand **) 00305 VSICalloc(sizeof(GDALRasterBand*), MAX(nNewBand,nBands)); 00306 else 00307 papoBands = (GDALRasterBand **) 00308 VSIRealloc(papoBands, sizeof(GDALRasterBand*) * 00309 MAX(nNewBand,nBands)); 00310 00311 for( i = nBands; i < nNewBand; i++ ) 00312 papoBands[i] = NULL; 00313 00314 nBands = MAX(nBands,nNewBand); 00315 } 00316 00317 /* -------------------------------------------------------------------- */ 00318 /* Set the band. Resetting the band is currently not permitted. */ 00319 /* -------------------------------------------------------------------- */ 00320 CPLAssert( papoBands[nNewBand-1] == NULL ); 00321 00322 papoBands[nNewBand-1] = poBand; 00323 00324 /* -------------------------------------------------------------------- */ 00325 /* Set back reference information on the raster band. Note */ 00326 /* that the GDALDataset is a friend of the GDALRasterBand */ 00327 /* specifically to allow this. */ 00328 /* -------------------------------------------------------------------- */ 00329 poBand->nBand = nNewBand; 00330 poBand->poDS = this; 00331 poBand->nRasterXSize = nRasterXSize; 00332 poBand->nRasterYSize = nRasterYSize; 00333 poBand->eAccess = eAccess; /* default access to be same as dataset */ 00334 } 00335 00336 /************************************************************************/ 00337 /* GetRasterXSize() */ 00338 /************************************************************************/ 00339 00350 int GDALDataset::GetRasterXSize() 00351 00352 { 00353 return nRasterXSize; 00354 } 00355 00356 /************************************************************************/ 00357 /* GDALGetRasterXSize() */ 00358 /************************************************************************/ 00359 00360 int GDALGetRasterXSize( GDALDatasetH hDataset ) 00361 00362 { 00363 return ((GDALDataset *) hDataset)->GetRasterXSize(); 00364 } 00365 00366 00367 /************************************************************************/ 00368 /* GetRasterYSize() */ 00369 /************************************************************************/ 00370 00381 int GDALDataset::GetRasterYSize() 00382 00383 { 00384 return nRasterYSize; 00385 } 00386 00387 /************************************************************************/ 00388 /* GDALGetRasterYSize() */ 00389 /************************************************************************/ 00390 00391 int GDALGetRasterYSize( GDALDatasetH hDataset ) 00392 00393 { 00394 return ((GDALDataset *) hDataset)->GetRasterYSize(); 00395 } 00396 00397 /************************************************************************/ 00398 /* GetRasterBand() */ 00399 /************************************************************************/ 00400 00414 GDALRasterBand * GDALDataset::GetRasterBand( int nBandId ) 00415 00416 { 00417 if( nBandId < 1 || nBandId > nBands ) 00418 { 00419 CPLError( CE_Fatal, CPLE_IllegalArg, 00420 "GDALDataset::GetRasterBand(%d) - Illegal band #\n", 00421 nBandId ); 00422 } 00423 00424 return( papoBands[nBandId-1] ); 00425 } 00426 00427 /************************************************************************/ 00428 /* GDALGetRasterBand() */ 00429 /************************************************************************/ 00430 00431 GDALRasterBandH GDALGetRasterBand( GDALDatasetH hDS, int nBandId ) 00432 00433 { 00434 return( (GDALRasterBandH) ((GDALDataset *) hDS)->GetRasterBand(nBandId) ); 00435 } 00436 00437 /************************************************************************/ 00438 /* GetRasterCount() */ 00439 /************************************************************************/ 00440 00449 int GDALDataset::GetRasterCount() 00450 00451 { 00452 return( nBands ); 00453 } 00454 00455 /************************************************************************/ 00456 /* GDALGetRasterCount() */ 00457 /************************************************************************/ 00458 00459 int GDALGetRasterCount( GDALDatasetH hDS ) 00460 00461 { 00462 return( ((GDALDataset *) hDS)->GetRasterCount() ); 00463 } 00464 00465 /************************************************************************/ 00466 /* GetProjectionRef() */ 00467 /************************************************************************/ 00468 00485 const char *GDALDataset::GetProjectionRef() 00486 00487 { 00488 return( "" ); 00489 } 00490 00491 /************************************************************************/ 00492 /* GDALGetProjectionRef() */ 00493 /************************************************************************/ 00494 00495 const char *GDALGetProjectionRef( GDALDatasetH hDS ) 00496 00497 { 00498 return( ((GDALDataset *) hDS)->GetProjectionRef() ); 00499 } 00500 00501 /************************************************************************/ 00502 /* SetProjection() */ 00503 /************************************************************************/ 00504 00520 CPLErr GDALDataset::SetProjection( const char * ) 00521 00522 { 00523 CPLError( CE_Failure, CPLE_NotSupported, 00524 "Dataset does not support the SetProjection() method." ); 00525 return CE_Failure; 00526 } 00527 00528 /************************************************************************/ 00529 /* GDALSetProjection() */ 00530 /************************************************************************/ 00531 00532 CPLErr GDALSetProjection( GDALDatasetH hDS, const char * pszProjection ) 00533 00534 { 00535 return( ((GDALDataset *) hDS)->SetProjection(pszProjection) ); 00536 } 00537 00538 /************************************************************************/ 00539 /* GetGeoTransform() */ 00540 /************************************************************************/ 00541 00572 CPLErr GDALDataset::GetGeoTransform( double * padfTransform ) 00573 00574 { 00575 CPLAssert( padfTransform != NULL ); 00576 00577 padfTransform[0] = 0.0; /* X Origin (top left corner) */ 00578 padfTransform[1] = 1.0; /* X Pixel size */ 00579 padfTransform[2] = 0.0; 00580 00581 padfTransform[3] = 0.0; /* Y Origin (top left corner) */ 00582 padfTransform[4] = 0.0; 00583 padfTransform[5] = 1.0; /* Y Pixel Size */ 00584 00585 return( CE_Failure ); 00586 } 00587 00588 /************************************************************************/ 00589 /* GDALGetGeoTransform() */ 00590 /************************************************************************/ 00591 00592 CPLErr GDALGetGeoTransform( GDALDatasetH hDS, double * padfTransform ) 00593 00594 { 00595 return( ((GDALDataset *) hDS)->GetGeoTransform(padfTransform) ); 00596 } 00597 00598 /************************************************************************/ 00599 /* SetGeoTransform() */ 00600 /************************************************************************/ 00601 00617 CPLErr GDALDataset::SetGeoTransform( double * ) 00618 00619 { 00620 CPLError( CE_Failure, CPLE_NotSupported, 00621 "SetGeoTransform() not supported for this dataset." ); 00622 00623 return( CE_Failure ); 00624 } 00625 00626 /************************************************************************/ 00627 /* GDALSetGeoTransform() */ 00628 /************************************************************************/ 00629 00630 CPLErr GDALSetGeoTransform( GDALDatasetH hDS, double * padfTransform ) 00631 00632 { 00633 return( ((GDALDataset *) hDS)->SetGeoTransform(padfTransform) ); 00634 } 00635 00636 /************************************************************************/ 00637 /* GetInternalHandle() */ 00638 /************************************************************************/ 00639 00651 void *GDALDataset::GetInternalHandle( const char * ) 00652 00653 { 00654 return( NULL ); 00655 } 00656 00657 /************************************************************************/ 00658 /* GDALGetInternalHandle() */ 00659 /************************************************************************/ 00660 00661 void *GDALGetInternalHandle( GDALDatasetH hDS, const char * pszRequest ) 00662 00663 { 00664 return( ((GDALDataset *) hDS)->GetInternalHandle(pszRequest) ); 00665 } 00666 00667 /************************************************************************/ 00668 /* GetDriver() */ 00669 /************************************************************************/ 00670 00680 GDALDriver * GDALDataset::GetDriver() 00681 00682 { 00683 return poDriver; 00684 } 00685 00686 /************************************************************************/ 00687 /* GDALGetDatasetDriver() */ 00688 /************************************************************************/ 00689 00690 GDALDriverH GDALGetDatasetDriver( GDALDatasetH hDataset ) 00691 00692 { 00693 return (GDALDriverH) ((GDALDataset *) hDataset)->GetDriver(); 00694 } 00695 00696 /************************************************************************/ 00697 /* Reference() */ 00698 /************************************************************************/ 00699 00710 int GDALDataset::Reference() 00711 00712 { 00713 return ++nRefCount; 00714 } 00715 00716 /************************************************************************/ 00717 /* GDALReferenceDataset() */ 00718 /************************************************************************/ 00719 00720 int GDALReferenceDataset( GDALDatasetH hDataset ) 00721 00722 { 00723 return ((GDALDataset *) hDataset)->Reference(); 00724 } 00725 00726 /************************************************************************/ 00727 /* Dereference() */ 00728 /************************************************************************/ 00729 00741 int GDALDataset::Dereference() 00742 00743 { 00744 return --nRefCount; 00745 } 00746 00747 /************************************************************************/ 00748 /* GDALDereferenceDataset() */ 00749 /************************************************************************/ 00750 00751 int GDALDereferenceDataset( GDALDatasetH hDataset ) 00752 00753 { 00754 return ((GDALDataset *) hDataset)->Dereference(); 00755 } 00756 00757 /************************************************************************/ 00758 /* GetShared() */ 00759 /************************************************************************/ 00760 00767 int GDALDataset::GetShared() 00768 00769 { 00770 return bShared; 00771 } 00772 00773 /************************************************************************/ 00774 /* MarkAsShared() */ 00775 /************************************************************************/ 00776 00781 void GDALDataset::MarkAsShared() 00782 00783 { 00784 CPLAssert( !bShared ); 00785 00786 bShared = TRUE; 00787 } 00788 00789 /************************************************************************/ 00790 /* GetGCPCount() */ 00791 /************************************************************************/ 00792 00801 int GDALDataset::GetGCPCount() 00802 00803 { 00804 return 0; 00805 } 00806 00807 /************************************************************************/ 00808 /* GDALGetGCPCount() */ 00809 /************************************************************************/ 00810 00811 int GDALGetGCPCount( GDALDatasetH hDS ) 00812 00813 { 00814 return ((GDALDataset *) hDS)->GetGCPCount(); 00815 } 00816 00817 /************************************************************************/ 00818 /* GetGCPProjection() */ 00819 /************************************************************************/ 00820 00831 const char *GDALDataset::GetGCPProjection() 00832 00833 { 00834 return ""; 00835 } 00836 00837 /************************************************************************/ 00838 /* GDALGetGCPProjection() */ 00839 /************************************************************************/ 00840 00841 const char *GDALGetGCPProjection( GDALDatasetH hDS ) 00842 00843 { 00844 return ((GDALDataset *) hDS)->GetGCPProjection(); 00845 } 00846 00847 /************************************************************************/ 00848 /* GetGCPs() */ 00849 /************************************************************************/ 00850 00860 const GDAL_GCP *GDALDataset::GetGCPs() 00861 00862 { 00863 return NULL; 00864 } 00865 00866 /************************************************************************/ 00867 /* GDALGetGCPs() */ 00868 /************************************************************************/ 00869 00870 const GDAL_GCP *GDALGetGCPs( GDALDatasetH hDS ) 00871 00872 { 00873 return ((GDALDataset *) hDS)->GetGCPs(); 00874 } 00875 00876 00877 /************************************************************************/ 00878 /* SetGCPs() */ 00879 /************************************************************************/ 00880 00906 CPLErr GDALDataset::SetGCPs( int nGCPCount, const GDAL_GCP *pasGCPList, 00907 const char *pszGCPProjection ) 00908 00909 { 00910 CPLError( CE_Failure, CPLE_NotSupported, 00911 "Dataset does not support the SetGCPs() method." ); 00912 00913 return CE_Failure; 00914 } 00915 00916 /************************************************************************/ 00917 /* GDALSetGCPs() */ 00918 /************************************************************************/ 00919 00920 CPLErr GDALSetGCPs( GDALDatasetH hDS, int nGCPCount, 00921 const GDAL_GCP *pasGCPList, 00922 const char *pszGCPProjection ) 00923 00924 { 00925 return ((GDALDataset *) hDS)->SetGCPs( nGCPCount, pasGCPList, 00926 pszGCPProjection ); 00927 } 00928 00929 /************************************************************************/ 00930 /* BuildOverviews() */ 00931 /************************************************************************/ 00932 00963 CPLErr GDALDataset::BuildOverviews( const char *pszResampling, 00964 int nOverviews, int *panOverviewList, 00965 int nListBands, int *panBandList, 00966 GDALProgressFunc pfnProgress, 00967 void * pProgressData ) 00968 00969 { 00970 CPLErr eErr; 00971 int *panAllBandList = NULL; 00972 00973 if( nListBands == 0 ) 00974 { 00975 nListBands = GetRasterCount(); 00976 panAllBandList = (int *) CPLMalloc(sizeof(int) * nListBands); 00977 for( int i = 0; i < nListBands; i++ ) 00978 panAllBandList[i] = i+1; 00979 00980 panBandList = panAllBandList; 00981 } 00982 00983 if( pfnProgress == NULL ) 00984 pfnProgress = GDALDummyProgress; 00985 00986 eErr = IBuildOverviews( pszResampling, nOverviews, panOverviewList, 00987 nListBands, panBandList, pfnProgress, pProgressData ); 00988 00989 if( panAllBandList != NULL ) 00990 CPLFree( panAllBandList ); 00991 00992 return eErr; 00993 } 00994 00995 /************************************************************************/ 00996 /* GDALBuildOverviews() */ 00997 /************************************************************************/ 00998 00999 CPLErr GDALBuildOverviews( GDALDatasetH hDataset, 01000 const char *pszResampling, 01001 int nOverviews, int *panOverviewList, 01002 int nListBands, int *panBandList, 01003 GDALProgressFunc pfnProgress, 01004 void * pProgressData ) 01005 01006 { 01007 return ((GDALDataset *) hDataset)->BuildOverviews( 01008 pszResampling, nOverviews, panOverviewList, nListBands, panBandList, 01009 pfnProgress, pProgressData ); 01010 } 01011 01012 /************************************************************************/ 01013 /* IBuildOverviews() */ 01014 /* */ 01015 /* Default implementation. */ 01016 /************************************************************************/ 01017 01018 CPLErr GDALDataset::IBuildOverviews( const char *pszResampling, 01019 int nOverviews, int *panOverviewList, 01020 int nListBands, int *panBandList, 01021 GDALProgressFunc pfnProgress, 01022 void * pProgressData ) 01023 01024 { 01025 if( pfnProgress == NULL ) 01026 pfnProgress = GDALDummyProgress; 01027 01028 if( oOvManager.IsInitialized() ) 01029 return oOvManager.BuildOverviews( NULL, pszResampling, 01030 nOverviews, panOverviewList, 01031 nListBands, panBandList, 01032 pfnProgress, pProgressData ); 01033 else 01034 { 01035 CPLError( CE_Failure, CPLE_NotSupported, 01036 "BuildOverviews() not supported for this dataset." ); 01037 01038 return( CE_Failure ); 01039 } 01040 } 01041 01042 /************************************************************************/ 01043 /* GetOpenDatasets() */ 01044 /************************************************************************/ 01045 01057 GDALDataset **GDALDataset::GetOpenDatasets( int *pnCount ) 01058 01059 { 01060 *pnCount = nGDALDatasetCount; 01061 return papoGDALDatasetList; 01062 } 01063 01064 /************************************************************************/ 01065 /* GDALGetOpenDatasets() */ 01066 /************************************************************************/ 01067 01068 void GDALGetOpenDatasets( GDALDatasetH ***hDS, int *pnCount ) 01069 01070 { 01071 *hDS = (GDALDatasetH **) GDALDataset::GetOpenDatasets( pnCount); 01072 } 01073 01074 /************************************************************************/ 01075 /* GDALGetAccess() */ 01076 /************************************************************************/ 01077 01078 int GDALGetAccess( GDALDatasetH hDS ) 01079 { 01080 return ((GDALDataset *) hDS)->GetAccess(); 01081 }