Using OGR in Python, I am attempting to modify the driver settings for S57. I am able to read the meta data from the driver as follows:

import ogr

driver = ogr.GetDriverByName("S57")

Which returns all the meta-data for the driver, I have removed some of it for the sake of the post length.

 'DMD_CREATIONOPTIONLIST': "<CreationOptionList>   <Option name='S57_EXPP' "
                           "type='int' description='Exchange purpose' "
                           "default='1'/>   <Option name='S57_INTU' type='int' "
                           "description='Intended usage' default='4'/>   "
                           "<Option name='S57_EDTN' type='string' "
                           "description='Edition number' default='2'/>   "
                           "<Option name='S57_UPDN' type='string' "
                           "description='Update number' default='0'/>   "
                           "<Option name='S57_UADT' type='string' "
                           "description='Update application date' "
                           "default='20030801'/>   <Option name='S57_ISDT' "
                           "type='string' description='Issue date' "
                           "default='20030801'/>   <Option name='S57_STED' "
                           "type='string' description='Edition number of S-57' "
                           "default='03.1'/>   <Option name='S57_AGEN' "
                           "type='int' description='Producing agency' "
                           "default='540'/>   <Option name='S57_COMT' "
                           "type='string' description='Comment' default=''/>   "
 'DMD_HELPTOPIC': 'drv_s57.html',
 'DMD_OPENOPTIONLIST': "<OpenOptionList>  <Option name='UPDATES' "
                       "type='string-select' description='Should update files "
                       "be incorporated into the base data on the fly' "
                       "default='APPLY'>    <Value>APPLY</Value>    "
                       '<Value>IGNORE</Value>  </Option>  <Option '
                       "name='SPLIT_MULTIPOINT' type='boolean' "
                       "description='Should multipoint soundings be split into "
                       "many single point sounding features' default='NO'/>  "
                       "<Option name='ADD_SOUNDG_DEPTH' type='boolean' "
                       "description='Should a DEPTH attribute be added on "
                       "SOUNDG features and assign the depth of the sounding' "
                       "default='NO'/>  <Option name='RETURN_PRIMITIVES' "
                       "type='boolean' description='Should all the low level "
                       'geometry primitives be returned as special '
                       "IsolatedNode, ConnectedNode, Edge and Face layers' "
                       "default='NO'/>  <Option name='PRESERVE_EMPTY_NUMBERS' "
                       "type='boolean' description='If enabled, numeric "
                       'attributes assigned an empty string as a value will be '
                       "preserved as a special numeric value' default='NO'/>  "
                       "<Option name='LNAM_REFS' type='boolean' "

Using the following functions

driver.SetMetadata({"DCAP_OPEN" : "NO"})

I am able to obtain the "higher"-level options and set them accordingly. However, I'm interested in modifying options within the DMD_CREATIONOPTIONLIST and DMD_OPENOPTIONLIST, such as setting the UPDATES option in the latter. How do I check the status of said option and setting it afterwards?

Edit: Specifically the options on page 301 "S57 Control Options" link

  • An easier reference to read might be: gdal.org/drivers/vector/s57.html
    – nmtoken
    Commented Aug 30, 2019 at 15:57
  • @nmtoken Whilst searching for possible solutions, I also stumbled upon this. However, I am unsure how to do this using Python? I'm fairly inexperienced.
    – Thomas
    Commented Sep 2, 2019 at 7:16

1 Answer 1


After investigating further what was suggested by @nmtoken, I finally managed to obtain some desirable results.

from osgeo import ogr
import os


driver = ogr.GetDriverByName("S57")
data = driver.Open("mapname")

The above snippet is able to set the options available in https://gdal.org/drivers/vector/s57.html. However, I am unable to verify that the settings are correctly loaded, besides looking at concrete map-based examples.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.