Skip to content

Commit

Permalink
Make geo_explode_collections option work with FileGDB import
Browse files Browse the repository at this point in the history
This option did not work with FileGDB imports, as there was an extra level of layer type checking which was not taking the option into account.
  • Loading branch information
simoneves authored and andrewseidl committed Jul 29, 2020
1 parent bb1f3aa commit d65e85d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ImportExport/Importer.cpp
Expand Up @@ -4340,6 +4340,14 @@ void Importer::readMetadataSampleGDAL(
case wkbPolygon:
case wkbMultiPolygon:
break;
case wkbMultiPoint:
case wkbMultiLineString:
// supported if geo_explode_collections is specified
if (!copy_params.geo_explode_collections) {
throw std::runtime_error("Unsupported geometry type: " +
std::string(poGeometry->getGeometryName()));
}
break;
default:
throw std::runtime_error("Unsupported geometry type: " +
std::string(poGeometry->getGeometryName()));
Expand Down Expand Up @@ -4690,6 +4698,13 @@ std::vector<Importer::GeoFileLayerInfo> Importer::gdalGetLayersInGeoFile(
// layer has supported geo
contents = GeoFileLayerContents::GEO;
break;
case wkbMultiPoint:
case wkbMultiLineString:
// supported if geo_explode_collections is specified
contents = copy_params.geo_explode_collections
? GeoFileLayerContents::GEO
: GeoFileLayerContents::UNSUPPORTED_GEO;
break;
default:
// layer has unsupported geometry
contents = GeoFileLayerContents::UNSUPPORTED_GEO;
Expand Down

0 comments on commit d65e85d

Please sign in to comment.