<div dir="ltr">I'm using ogr2ogr to import KML/KMZ files with GDAL 3.2.2 on Debian 11, which is built with the LibKML driver.<div><br></div><div>From our tests we see that this driver always reports KML folders as GeometryCollection layers, even though they only contain a single geometry type</div><div>On the other hand the KML driver is able to tell the right geometry type for each folder. It returns GeometryCollection only for folders containing mixed contents.</div><div><br></div><div>Using the sample KML from here <a href="https://developers.google.com/static/kml/documentation/KML_Samples.kml">https://developers.google.com/static/kml/documentation/KML_Samples.kml</a><br></div><div><br></div><div>$ogrinfo KML_Samples.kml -so</div>INFO: Open of `KML_Samples.kml'<br>      using driver `LIBKML' successful.<br>1: Placemarks<br>2: Styles and Markup<br>3: Highlighted Icon<br>4: Ground Overlays<br>5: Screen Overlays<br>6: Paths<br>7: Polygons<br>8: Google Campus<br>9: Extruded Polygon<br>10: Absolute and Relative<div><br></div><div>Forcing ogr to use the KML driver we get the expected geometry types:</div><div><br></div><div>$export OGR_SKIP="LibKML"</div><div>$ogrinfo KML_Samples.kml -so</div>INFO: Open of `KML_Samples.kml'<br>      using driver `KML' successful.<br>1: Placemarks (3D Point)<br>2: Highlighted Icon (3D Point)<br>3: Paths (3D Line String)<br>4: Google Campus (3D Polygon)<br>5: Extruded Polygon (3D Polygon)<br>6: Absolute and Relative (3D Polygon)<div><br></div><div>The documentation for the LibKML driver says "OGR will try to map <MultiGeometry> to the more precise OGR geometry type (MultiPoint, MultiLineString or MultiPolygon), and default to GeometryCollection in case of mixed content." (<a href="https://gdal.org/drivers/vector/libkml.html#geometry">https://gdal.org/drivers/vector/libkml.html#geometry</a>). </div><div><br></div><div>This example doesn't contain folders with mixed types. Does the driver consider mixed content globally?</div><div><br></div><div>Giovanni</div><div><br></div></div>