Skip to content

Commit

Permalink
ENH: Renamed cderived -> derived (as it is not limited to complex dat…
Browse files Browse the repository at this point in the history
…asets)
  • Loading branch information
jmichel-otb committed Jul 7, 2016
1 parent a42afc2 commit c32128a
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# Test opening a L1C product


def cderived_test():
def derived_test():
filename = "data/cfloat64.tif"
gdal.ErrorReset()
ds = gdal.Open(filename)
Expand Down Expand Up @@ -86,7 +86,7 @@ def cderived_test():

if __name__ == '__main__':

gdaltest.setup_run( 'cderived' )
gdaltest.setup_run( 'derived' )

gdaltest.run_tests( gdaltest_list )

Expand Down
2 changes: 1 addition & 1 deletion gdal/GDALmake.opt.in
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ GDAL_FORMATS += nitf bmp airsar rs2 ilwis rmf leveller sgi srtmhgt
GDAL_FORMATS += idrisi gsg ingr ers jaxapalsar dimap gff cosar pds adrg
GDAL_FORMATS += coasp tsx terragen blx msgn til r northwood saga xyz hf2
GDAL_FORMATS += kmlsuperoverlay ctg e00grid zmap ngsgeoid iris map cals
GDAL_FORMATS += safe sentinel2 cderived
GDAL_FORMATS += safe sentinel2 derived
GDAL_FORMATS += @OPT_GDAL_FORMATS@

ifneq ($(PCIDSK_SETTING),no)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

include ../../GDALmake.opt

OBJ = cderiveddataset.o derivedlist.o
OBJ = deriveddataset.o derivedlist.o

default: $(OBJ:.o=.$(OBJ_EXT))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,27 @@
#include "gdal_proxy.h"
#include "derivedlist.h"

class ComplexDerivedDataset : public VRTDataset
class DerivedDataset : public VRTDataset
{
public:
ComplexDerivedDataset(int nXSize, int nYSize);
~ComplexDerivedDataset();
DerivedDataset(int nXSize, int nYSize);
~DerivedDataset();

static GDALDataset *Open( GDALOpenInfo * );
};


ComplexDerivedDataset::ComplexDerivedDataset(int nXSize, int nYSize) : VRTDataset(nXSize,nYSize)
DerivedDataset::DerivedDataset(int nXSize, int nYSize) : VRTDataset(nXSize,nYSize)
{
poDriver = NULL;
SetWritable(FALSE);
}

ComplexDerivedDataset::~ComplexDerivedDataset()
DerivedDataset::~DerivedDataset()
{
}

GDALDataset * ComplexDerivedDataset::Open(GDALOpenInfo * poOpenInfo)
GDALDataset * DerivedDataset::Open(GDALOpenInfo * poOpenInfo)
{
/* Try to open original dataset */
CPLString filename(poOpenInfo->pszFilename);
Expand All @@ -75,7 +75,7 @@ GDALDataset * ComplexDerivedDataset::Open(GDALOpenInfo * poOpenInfo)

CPLString odDerivedName = filename.substr(dsds_pos+nPrefixLen,alg_pos-dsds_pos-nPrefixLen);

CPLDebug("ComplexDerivedDataset::Open","Derived dataset requested: %s",odDerivedName.c_str());
CPLDebug("DerivedDataset::Open","Derived dataset requested: %s",odDerivedName.c_str());

CPLString pixelFunctionName = "";
bool datasetFound = false;
Expand Down Expand Up @@ -116,7 +116,7 @@ GDALDataset * ComplexDerivedDataset::Open(GDALOpenInfo * poOpenInfo)
int nRows = poTmpDS->GetRasterYSize();
int nCols = poTmpDS->GetRasterXSize();

ComplexDerivedDataset * poDS = new ComplexDerivedDataset(nCols,nRows);
DerivedDataset * poDS = new DerivedDataset(nCols,nRows);

// Transfer metadata
poDS->SetMetadata(poTmpDS->GetMetadata());
Expand Down Expand Up @@ -169,24 +169,24 @@ GDALDataset * ComplexDerivedDataset::Open(GDALOpenInfo * poOpenInfo)
return poDS;
}

void GDALRegister_ComplexDerived()
void GDALRegister_Derived()
{
if( GDALGetDriverByName( "COMPLEXDERIVED" ) != NULL )
if( GDALGetDriverByName( "DERIVED" ) != NULL )
return;

GDALDriver *poDriver = new GDALDriver();

poDriver->SetDescription( "COMPLEXDERIVED" );
poDriver->SetDescription( "DERIVED" );
#ifdef GDAL_DCAP_RASTER
poDriver->SetMetadataItem( GDAL_DCAP_RASTER, "YES" );
#endif
poDriver->SetMetadataItem( GDAL_DCAP_VIRTUALIO, "YES" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "Complex derived bands" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "Derived datasets using VRT pixel functions" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "TODO" );
poDriver->SetMetadataItem( GDAL_DMD_SUBDATASETS, "NO" );

poDriver->pfnOpen = ComplexDerivedDataset::Open;
poDriver->pfnIdentify = ComplexDerivedDataset::Identify;
poDriver->pfnOpen = DerivedDataset::Open;
poDriver->pfnIdentify = DerivedDataset::Identify;

GetGDALDriverManager()->RegisterDriver( poDriver );
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

OBJ = cderiveddataset.obj derivedlist.obj
OBJ = deriveddataset.obj derivedlist.obj

GDAL_ROOT = ..\..

Expand Down
2 changes: 1 addition & 1 deletion gdal/frmts/gdalallregister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void CPL_STDCALL GDALAllRegister()

#ifdef FRMT_vrt
GDALRegister_VRT();
GDALRegister_ComplexDerived();
GDALRegister_Derived();
#endif

#ifdef FRMT_gtiff
Expand Down
2 changes: 1 addition & 1 deletion gdal/gcore/gdal_frmts.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void CPL_DLL GDALRegister_SAFE(void);
void CPL_DLL GDALRegister_SENTINEL2(void);
void CPL_DLL GDALRegister_mrf(void);
void CPL_DLL GDALRegister_RRASTER(void);
void CPL_DLL GDALRegister_ComplexDerived(void);
void CPL_DLL GDALRegister_Derived(void);
CPL_C_END

#endif /* ndef GDAL_FRMTS_H_INCLUDED */
2 changes: 1 addition & 1 deletion gdal/gcore/gdaldataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "ograpispy.h"
#include "ogrunionlayer.h"
#include "swq.h"
#include "../frmts/cderived/derivedlist.h"
#include "../frmts/derived/derivedlist.h"

#ifdef SQLITE_ENABLED
#include "../sqlite/ogrsqliteexecutesql.h"
Expand Down

0 comments on commit c32128a

Please sign in to comment.