I'm trying to do the same as the ogr2ogr example given by https://gis.stackexchange.com/a/119404/6458
The difference is that my inputs are a GML and a shapefile. Export.shp should only contain the data in input.gml intersecting with buffer.shp. I don't receive an error, but I also don't get an output:
ogr2ogr -f "ESRI Shapefile" -sql "CREATE VIRTUAL TABLE Buffer USING VirtualOGR('buffer.shp', 0, 'buffer');SELECT ST_Intersection(A.geometry, B.geometry) AS geometry, A.*, B.* FROM Layername A, Buffer B WHERE ST_Intersects(A.geometry, B.geometry)" -dialect SQLITE export.shp input.gml
'Layername' here in the SQL refers to the layer name in the input.gml
Does anyone have an idea of what is going wrong?