<s> from osgeo import ogr <EOL> shp_ds = ogr . Open ( r'<STR_LIT>' ) <EOL> volcano_lyr = shp_ds . GetLayer ( '<STR_LIT>' ) <EOL> cities_lyr = shp_ds . GetLayer ( '<STR_LIT>' ) <EOL> memory_driver = ogr . GetDriverByName ( '<STR_LIT>' ) <EOL> memory_ds = memory_driver . CreateDataSource ( '<STR_LIT>' ) <EOL> buff_lyr = memory_ds . CreateLayer ( '<STR_LIT>' ) <EOL> buff_feat = ogr . Feature ( buff_lyr . GetLayerDefn ( ) ) <EOL> for volcano_feat in volcano_lyr : <EOL> buff_geom = volcano_feat . geometry ( ) . Buffer ( <NUM_LIT> ) <EOL> tmp = buff_feat . SetGeometry ( buff_geom ) <EOL> tmp = buff_lyr . CreateFeature ( buff_feat ) <EOL> result_lyr = memory_ds . CreateLayer ( '<STR_LIT:result>' ) <EOL> buff_lyr . Intersection ( cities_lyr , result_lyr ) <EOL> print ( '<STR_LIT>' . format ( result_lyr . GetFeatureCount ( ) ) ) </s>
