a guest Aug 13th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- from osgeo import ogr
- shapefile = ogr.Open( "shapfile.shp",1 )
- for feature in range(count):
- ogr2ogr output.shp input.shp -where "FID < 0"
- import shapefile
- r = shapefile.Reader("myshape")
- w = shapefile.Writer(r.shapeType)
- # This line will give us the same dbf schema
- w.fields = r.fields
- # Use the original bounding box as a place holder in the header
- w.bbox = lambda: r.bbox
- w.bbox = lambda: [0.0, 0.0, 0.0, 0.0]
RAW Paste Data