@@ -0,0 +1,931 @@
+import os%0Afrom osgeo import ogr, osr%0Aimport glob%0A%0Aprint 'inicio'%0A%0Alista = ('RO', 'RR', 'TO')%0A%0Afor item in lista:%0A    outputMergefn = 'C:%5C%5CBiondo%5C%5CALOS_PRODES%5C%5Cfloresta%5C%5Cmerge%5C%5C'+item+'_merge.shp'%0A    driverName = 'ESRI Shapefile'%0A    geometryType = ogr.wkbPolygon%0A%0A    out_driver = ogr.GetDriverByName( driverName )%0A    if os.path.exists(outputMergefn):%0A%09out_driver.DeleteDataSource(outputMergefn)%0A    out_ds = out_driver.CreateDataSource(outputMergefn)%0A    out_layer = out_ds.CreateLayer(outputMergefn, geom_type=geometryType)%0A%0A    fileList = glob.glob('C:%5C%5CBiondo%5C%5CALOS_PRODES%5C%5Cfloresta%5C%5CP*'+item+'*.shp')%0A%0A    for file in fileList:%0A%09if file.endswith('.shp'):%0A%09    print file%0A%09    ds = ogr.Open(file)%0A%09    lyr = ds.GetLayer()%0A%09    for feat in lyr:%0A%09%09out_feat = ogr.Feature(out_layer.GetLayerDefn())%0A%09%09out_feat.SetGeometry(feat.GetGeometryRef().Clone())%0A%09%09out_layer.CreateFeature(out_feat)%0A%09%09out_layer.SyncToDisk()%0A%09%0A%0Aprint 'FIM'%0A

Create OGR_MergeLayers.py