Skip to content

Commit

Permalink
Merge pull request #10200 from rouault/fix_10199
Browse files Browse the repository at this point in the history
Fix crash in ogr2ogr (or Arrow based workflows) from GeoPackage/GeoParquet to PMTiles (3.9.0 regression)
  • Loading branch information
rouault committed Jun 13, 2024
2 parents f555f47 + 1970554 commit e3933fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
22 changes: 14 additions & 8 deletions ogr/ogrsf_frmts/generic/ogrlayerarrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5862,10 +5862,13 @@ bool OGRLayer::CreateFieldFromArrowSchemaInternal(
if (poDS)
{
auto poDriver = poDS->GetDriver();
const char *pszMetadataItem =
poDriver->GetMetadataItem(GDAL_DMD_CREATIONFIELDDATATYPES);
if (pszMetadataItem)
aosNativeTypes = CSLTokenizeString2(pszMetadataItem, " ", 0);
if (poDriver)
{
const char *pszMetadataItem =
poDriver->GetMetadataItem(GDAL_DMD_CREATIONFIELDDATATYPES);
if (pszMetadataItem)
aosNativeTypes = CSLTokenizeString2(pszMetadataItem, " ", 0);
}
}

if (schema->dictionary &&
Expand Down Expand Up @@ -7374,10 +7377,13 @@ bool OGRLayer::WriteArrowBatch(const struct ArrowSchema *schema,
if (poDS)
{
auto poDriver = poDS->GetDriver();
const char *pszMetadataItem =
poDriver->GetMetadataItem(GDAL_DMD_CREATIONFIELDDATATYPES);
if (pszMetadataItem)
aosNativeTypes = CSLTokenizeString2(pszMetadataItem, " ", 0);
if (poDriver)
{
const char *pszMetadataItem =
poDriver->GetMetadataItem(GDAL_DMD_CREATIONFIELDDATATYPES);
if (pszMetadataItem)
aosNativeTypes = CSLTokenizeString2(pszMetadataItem, " ", 0);
}
}

std::vector<FieldInfo> asFieldInfo;
Expand Down
2 changes: 2 additions & 0 deletions ogr/ogrsf_frmts/mvt/ogrmvtdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6185,6 +6185,8 @@ GDALDataset *OGRMVTWriterDataset::Create(const char *pszFilename, int nXSize,
}

poDS->SetDescription(pszFilename);
poDS->poDriver = GDALDriver::FromHandle(GDALGetDriverByName("MVT"));

return poDS;
}

Expand Down

0 comments on commit e3933fb

Please sign in to comment.