I want to select the (Sumava) from the attribute table and then make a shapefile. My problem is I don't know which function should I use to select this area.
If any one can help me?
import ogr
import os
direction_parks = 'ArcCR500_v32/ChranenaUzemi.shp'
direction_result = 'ArcCR500_v32/result.shp'
open_parks = ogr.Open(direction_parks)
layer_park = open_parks.GetLayer(0)
layer_park.SetAttributeFilter("???????")
number_park = layer_park.GetFeatureCount()
driver = ogr.GetDriverByName("ESRI shapefile")
if os.path.exists(direction_result):
driver.DeleteDataSource(direction_result)
dataset = driver.CreateDataSource(direction_result)
new_layer = dataset.CreateLayer(direction_result, geom_type= ogr.wkbPolygon)
number = 0
for j in range(0, number_park):
h = layer_park.GetNextFeature()
h_geometry = h.GetGeometryRef()
new_layer.CreateFeature(h)
dataset.Destroy()