@@ -3063,6 +3063,17 @@ bool MBTilesDataset::CreateInternal(const char *pszFilename, int nXSize,
30633063 sqlite3_exec (hDB, pszSQL, nullptr , nullptr , nullptr );
30643064 sqlite3_free (pszSQL);
30653065
3066+ const std::string osElevationType =
3067+ CSLFetchNameValueDef (papszOptions, " ELEVATION_TYPE" , " " );
3068+ if (!osElevationType.empty ())
3069+ {
3070+ pszSQL = sqlite3_mprintf (" INSERT INTO metadata (name, value) VALUES "
3071+ " ('elevation_type', '%q')" ,
3072+ osElevationType.c_str ());
3073+ sqlite3_exec (hDB, pszSQL, nullptr , nullptr , nullptr );
3074+ sqlite3_free (pszSQL);
3075+ }
3076+
30663077 const char *pszTF = CSLFetchNameValue (papszOptions, " TILE_FORMAT" );
30673078 if (pszTF)
30683079 m_eTF = GDALGPKGMBTilesGetTileFormat (pszTF);
@@ -3754,6 +3765,11 @@ void GDALRegister_MBTiles()
37543765 " <Value>overlay</Value>"
37553766 " <Value>baselayer</Value>"
37563767 " </Option>"
3768+ " <Option name='ELEVATION_TYPE' scope='raster' type='string-select' "
3769+ " description='Type of elevation encoding' default=''>"
3770+ " <Value></Value>"
3771+ " <Value>terrain-rgb</Value>"
3772+ " </Option>"
37573773 " <Option name='VERSION' scope='raster' type='string' "
37583774 " description='The version of the tileset, as a plain number' "
37593775 " default='1.1'/>"
0 commit comments