Hi all, sample script to reproduce:
""" from osgeo import ogr odrv = ogr.GetDriverByName("PostgreSQL") ods = odrv.Open("PG:dbname=pgis_vfr", True) layerName = 'obce' if not ods.GetLayerByName(layerName): print "Layer not found, creating..." ods.CreateLayer(layerName, None, ogr.wkbPoint, []) else: print "Layer found" ods.SyncToDisk() ods.Destroy() """ 1) first run - table exists in DB Layer found 2) drop table obce; 3) second run ERROR 1: No field definitions found for 'obce', is it a table? <- this goes from GetLayerByName() / ReadTableDefinition() <- why report it as an error, I just what to check if layer exists... Layer not found, creating... Using GDAL 1.12dev, PostGIS 2.1. Thanks, Martin -- Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev