from osgeo import ogr import os DriverName = "ESRI Shapefile" # e.g.: GeoJSON, ESRI Shapefile FileName = 'test.shp' driver = ogr.GetDriverByName(DriverName) if os.path.exists(FileName): driver.DeleteDataSource(FileName) try: from osgeo import ogr print 'Import of ogr from osgeo worked. Hurray!\n' except: print 'Import of ogr from osgeo failed\n\n' This code simply prints out the auto-generated hel
![Vector Layers — Python GDAL/OGR Cookbook 1.0 documentation](https://cdn-ak-scissors.b.st-hatena.com/image/square/6732cae3f6b91cbccb9230213ca5c704a957ff98/height=288;version=1;width=512/https%3A%2F%2Fpcjericks.github.io%2Fpy-gdalogr-cookbook%2F_images%2Flayer_fishnet.png)