<div dir="ltr"><div><div><div><div><div><div>Hi<br><br></div>I have some contour lines which I clip with ogr2ogr's -clipsrc options. As a result and in very rare cases I get some GeometryCollections which cannot be stored in a  shapefile. <br><br></div>So I'm clipping to a GeoPackage and tried to extract the LinesStrings from the GeometryCollections with the following command:<br><br>ogr2ogr -dialect INDIRECT_SQLITE -sql 'SELECT ID, elev, (ST_Dump(geom)).geom as geom FROM linestring WHERE geometrytype = \'LINESTRING'\' clipped_dumped.shp clipped.gpkg<br><br></div>ST_Dump seems to be unknown (as SQlite does not support arrays I guess) so is ST_CollectionExtract(geom,2). <br><br></div>Is there a way to extract LineStrings from GeometryCollections. Probably already avoiding them when clipping the original geometry?<br><br></div>best regards<br></div>Stefan<br><div><div><div><div><br><br></div></div></div></div></div>