Skip to content

Commit

Permalink
Drivers: declare GDAL_DCAP_UPDATE and GDAL_DMD_UPDATE_ITEMS where rel…
Browse files Browse the repository at this point in the history
…evant
  • Loading branch information
rouault committed Jan 25, 2025
1 parent ae51ae4 commit 1b5c4c1
Show file tree
Hide file tree
Showing 26 changed files with 108 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frmts/ecw/ecwdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ void ECWDriverSetCommonMetadata(GDALDriver *poDriver)
// for ECWCreateCopyECW().
poDriver->SetMetadataItem(GDAL_DCAP_VIRTUALIO, "YES");
#endif

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS,
"GeoTransform SRS "
"DatasetMetadata BandMetadata");
}

/************************************************************************/
Expand Down
6 changes: 6 additions & 0 deletions frmts/gtiff/geotiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,12 @@ void GDALRegister_GTiff()
poDriver->SetMetadataItem(GDAL_DMD_SUBDATASETS, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_VIRTUALIO, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS,
"GeoTransform SRS GCPs NoData "
"ColorInterpretation RasterValues "
"DatasetMetadata BandMetadata");

#ifdef INTERNAL_LIBTIFF
poDriver->SetMetadataItem("LIBTIFF", "INTERNAL");
#else
Expand Down
6 changes: 6 additions & 0 deletions frmts/hfa/hfadataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5233,6 +5233,12 @@ void GDALRegister_HFA()

poDriver->SetMetadataItem(GDAL_DCAP_VIRTUALIO, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS,
"GeoTransform SRS NoData "
"RasterValues "
"DatasetMetadata BandMetadata");

poDriver->pfnOpen = HFADataset::Open;
poDriver->pfnCreate = HFADataset::Create;
poDriver->pfnCreateCopy = HFADataset::CreateCopy;
Expand Down
6 changes: 6 additions & 0 deletions frmts/kea/keadrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ void KEADriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATECOPY, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS,
"GeoTransform SRS GCPs NoData "
"ColorInterpretation RasterValues "
"DatasetMetadata BandMetadata");
}

/************************************************************************/
Expand Down
5 changes: 5 additions & 0 deletions frmts/netcdf/netcdfdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,11 @@ void netCDFDriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATECOPY, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE_MULTIDIMENSIONAL, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS,
"GeoTransform SRS " // if not already set...
"DatasetMetadata BandMetadata RasterValues");
}

/************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions frmts/nitf/nitfdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ void NITFDriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATECOPY, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "RasterValues");
}

/************************************************************************/
Expand Down
6 changes: 6 additions & 0 deletions frmts/pcidsk/pcidskdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ void PCIDSKDriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->pfnIdentify = PCIDSKDriverIdentify;
poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS,
"GeoTransform SRS "
"DatasetMetadata BandMetadata "
"RasterValues Features");
}

/************************************************************************/
Expand Down
4 changes: 4 additions & 0 deletions frmts/pdf/pdfdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ void PDFDriverSetCommonMetadata(GDALDriver *poDriver)

poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATECOPY, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS,
"GeoTransform SRS GCPs DatasetMetadata");
}

/************************************************************************/
Expand Down
4 changes: 4 additions & 0 deletions frmts/raw/ehdrdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2030,6 +2030,10 @@ void GDALRegister_EHdr()
"signed byte'/>"
"</CreationOptionList>");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "GeoTransform SRS NoData "
"RasterValues");

poDriver->SetMetadataItem(GDAL_DCAP_VIRTUALIO, "YES");
poDriver->pfnOpen = EHdrDataset::Open;
poDriver->pfnCreate = EHdrDataset::Create;
Expand Down
5 changes: 5 additions & 0 deletions frmts/raw/envidataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2941,6 +2941,11 @@ void GDALRegister_ENVI()
" </Option>"
"</CreationOptionList>");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS,
"GeoTransform SRS GCPs NoData "
"RasterValues DatasetMetadata");

poDriver->SetMetadataItem(GDAL_DCAP_VIRTUALIO, "YES");
poDriver->pfnOpen = ENVIDataset::Open;
poDriver->pfnCreate = ENVIDataset::Create;
Expand Down
5 changes: 5 additions & 0 deletions frmts/raw/rrasterdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1555,5 +1555,10 @@ void GDALRegister_RRASTER()
poDriver->pfnCreate = RRASTERDataset::Create;
poDriver->pfnCreateCopy = RRASTERDataset::CreateCopy;

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "GeoTransform SRS NoData "
"RasterValues "
"DatasetMetadata");

GetGDALDriverManager()->RegisterDriver(poDriver);
}
3 changes: 3 additions & 0 deletions frmts/tiledb/tiledbdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ void TileDBDriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATECOPY, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "RasterValues Features");

poDriver->SetMetadataItem(
"TILEDB_VERSION",
STRINGIFY(TILEDB_VERSION_MAJOR) "." STRINGIFY(
Expand Down
6 changes: 6 additions & 0 deletions frmts/vrt/vrtdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,12 @@ void GDALRegister_VRT()
poDriver->SetMetadataItem(GDAL_DCAP_VIRTUALIO, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_COORDINATE_EPOCH, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS,
"GeoTransform SRS GCPs NoData "
"ColorInterpretation "
"DatasetMetadata BandMetadata");

const char *pszExpressionDialects = "ExpressionDialects";
#if defined(GDAL_VRT_ENABLE_MUPARSER) && defined(GDAL_VRT_ENABLE_EXPRTK)
poDriver->SetMetadataItem(pszExpressionDialects, "muparser,exprtk");
Expand Down
6 changes: 6 additions & 0 deletions frmts/zarr/zarrdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ void ZARRDriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE_MULTIDIMENSIONAL, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS,
"GeoTransform SRS NoData "
"RasterValues "
"DatasetMetadata BandMetadata");
}

/************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions ogr/ogrsf_frmts/csv/ogrcsvdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ void RegisterOGRCSV()
"Boolean Int16 Float32");
poDriver->SetMetadataItem(GDAL_DCAP_HONOR_GEOM_COORDINATE_PRECISION, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "Features");

poDriver->pfnOpen = OGRCSVDriverOpen;
poDriver->pfnIdentify = OGRCSVDriverIdentify;
poDriver->pfnCreate = OGRCSVDriverCreate;
Expand Down
3 changes: 3 additions & 0 deletions ogr/ogrsf_frmts/geojson/ogrgeojsondriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,9 @@ void RegisterOGRGeoJSON()
poDriver->SetMetadataItem(GDAL_DCAP_FLUSHCACHE_CONSISTENT_STATE, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_HONOR_GEOM_COORDINATE_PRECISION, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "Features");

poDriver->pfnOpen = OGRGeoJSONDriverOpen;
poDriver->pfnIdentify = OGRGeoJSONDriverIdentify;
poDriver->pfnCreate = OGRGeoJSONDriverCreate;
Expand Down
5 changes: 5 additions & 0 deletions ogr/ogrsf_frmts/gpkg/ogrgeopackagedriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,11 @@ void RegisterOGRGeoPackage()
poDriver->SetMetadataItem("SQLITE_HAS_COLUMN_METADATA", "YES");
#endif

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS,
"DatasetMetadata BandMetadata RasterValues "
"LayerMetadata Features");

poDriver->pfnOpen = OGRGeoPackageDriverOpen;
poDriver->pfnIdentify = OGRGeoPackageDriverIdentify;
poDriver->pfnCreate = OGRGeoPackageDriverCreate;
Expand Down
3 changes: 3 additions & 0 deletions ogr/ogrsf_frmts/libkml/ogrlibkmldrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ void OGRLIBKMLDriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->pfnIdentify = OGRLIBKMLDriverIdentify;
poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "Features");
}

/************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions ogr/ogrsf_frmts/mitab/mitab_ogr_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ void RegisterOGRTAB()
poDriver->SetMetadataItem(GDAL_DCAP_FEATURE_STYLES_READ, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_FEATURE_STYLES_WRITE, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "Features");

poDriver->pfnOpen = OGRTABDriverOpen;
poDriver->pfnIdentify = OGRTABDriverIdentify;
poDriver->pfnCreate = OGRTABDriverCreate;
Expand Down
3 changes: 3 additions & 0 deletions ogr/ogrsf_frmts/mssqlspatial/ogrmssqlspatialdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ void OGRMSSQLSPATIALDriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->pfnIdentify = OGRMSSQLSPATIALDriverIdentify;
poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "Features");
}

/************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions ogr/ogrsf_frmts/mysql/ogrmysqldrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ void OGRMySQLDriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->pfnIdentify = OGRMySQLDriverIdentify;
poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "Features");
}

/************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions ogr/ogrsf_frmts/oci/ogrocidrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ void OGROCIDriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->pfnIdentify = OGROCIDriverIdentify;
poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "Features");
}

/************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ void OGROpenFileGDBDriverSetCommonMetadata(GDALDriver *poDriver)
"fields' default='NO'/>"
"</LayerCreationOptionList>");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "Features");

// Setting to another value than the default one doesn't really work
// with the SDK
// Option name='AREA_FIELD_NAME' type='string' description='Name of
Expand Down
3 changes: 3 additions & 0 deletions ogr/ogrsf_frmts/pg/ogrpgdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ void OGRPGDriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->pfnIdentify = OGRPGDriverIdentify;
poDriver->SetMetadataItem(GDAL_DCAP_OPEN, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_CREATE, "YES");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "LayerMetadata Features");
}

/************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions ogr/ogrsf_frmts/shape/ogrshapedriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ void RegisterOGRShape()

poDriver->SetMetadataItem(GDAL_DMD_ALTER_GEOM_FIELD_DEFN_FLAGS, "SRS");

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "Features");

poDriver->pfnOpen = OGRShapeDriverOpen;
poDriver->pfnIdentify = OGRShapeDriverIdentify;
poDriver->pfnCreate = OGRShapeDriverCreate;
Expand Down
3 changes: 3 additions & 0 deletions ogr/ogrsf_frmts/sqlite/ogrsqlitedriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ void RegisterOGRSQLite()
poDriver->SetMetadataItem("SQLITE_HAS_COLUMN_METADATA", "YES");
#endif

poDriver->SetMetadataItem(GDAL_DCAP_UPDATE, "YES");
poDriver->SetMetadataItem(GDAL_DMD_UPDATE_ITEMS, "Features");

poDriver->pfnOpen = OGRSQLiteDriverOpen;
poDriver->pfnIdentify = OGRSQLiteDriverIdentify;
poDriver->pfnCreate = OGRSQLiteDriverCreate;
Expand Down

0 comments on commit 1b5c4c1

Please sign in to comment.