[Gdal-dev] s-57 layer problem

Fulko van Westrenen fwes at lina.dto.tudelft.nl
Wed Mar 31 12:14:24 EST 2004


Hello,

Until now I used a S-57 map-file containing all layers
I needed. My real map consists of many files, and most
of them do not contain all layers. The result looks like
this:

  File "./test.gtk.py", line 593, in load_allmaps
    load_map(files[i])
  File "./test.gtk.py", line 574, in load_map
    bouyslat=load_objects(dataset,'BOYLAT')
  File "./test.gtk.py", line 513, in load_objects
    objects=dataset.GetLayerByName( name )
  File "/usr/lib/python2.3/site-packages/ogr.py", line 286, in GetLayerByName
    raise IndexError, 'No layer %s on datasource' % name 
IndexError: No layer BOYLAT on datasource

Can someone tell me how to test for the existence of a layer
before loading it?

Thanks,
Fulko





More information about the Gdal-dev mailing list