1

Trying conver s57 files to shape. First added enviroment variable:

OGR_S57_OPTIONS
with value
RETURN_PRIMITIVES=ON,RETURN_LINKAGES=ON,LNAM_REFS=ON

Then run:

ogr2ogr -overwrite  -skipfailures "US1GC09M_1.shp" -nlt point "US1GC09M.000"  wrecks

But have got multiple errors:

Warning 1: The output driver does not natively support StringList type for field LNAM_REFS. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type StringList on shapefile layers.
Warning 1: The output driver does not natively support IntegerList type for field FFPT_RIND. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type IntegerList on shapefile layers.
Warning 1: The output driver does not natively support IntegerList type for field NAME_RCNM. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type IntegerList on shapefile layers.
Warning 1: The output driver does not natively support IntegerList type for field NAME_RCID. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type IntegerList on shapefile layers.
Warning 1: The output driver does not natively support IntegerList type for field ORNT. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type IntegerList on shapefile layers.
Warning 1: The output driver does not natively support IntegerList type for field USAG. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type IntegerList on shapefile layers.
Warning 1: The output driver does not natively support IntegerList type for field MASK. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type IntegerList on shapefile layers.
Warning 1: The output driver does not natively support StringList type for field QUASOU. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type StringList on shapefile layers.
Warning 1: The output driver does not natively support StringList type for field STATUS. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type StringList on shapefile layers.
Warning 1: The output driver does not natively support StringList type for field TECSOU. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type StringList on shapefile layers.

Gdal version:

GDAL 3.3.1, released 2021/06/28

ANy advice? I forgot to do something?

5
  • 1
    You cannot save attributes that contain a list of values into shapefile format. You can have a try with ogr2ogr option -splitlistfields and split such attributes into many regular string fields.
    – user30184
    Commented Aug 8, 2021 at 14:06
  • The s57 driver gdal.org/drivers/vector/s57.html has also an option LIST_AS_STRING=ON.
    – user30184
    Commented Aug 8, 2021 at 14:17
  • @user30184 -splitlistfields option quiet helps. I mean errors gone, but ofc the option creates more fields in output file than in input file.
    – Kliver Max
    Commented Aug 8, 2021 at 14:26
  • @user30184 I tryed LIST_AS_STRING=ON but a still got same errors when i ran ogr2ogr without -splitlistfields. So i even don't understand that OGR_S57_OPTIONS variable works or not. Is there any way to check it?
    – Kliver Max
    Commented Aug 8, 2021 at 14:30
  • It is natural that splitfields adds fields. That is the intention of the option. S57 supports list attributes, for example COLOR=1 COLOR=4. With shapefile there are two options: add both values into one COLOR=1,4 or split the attribute COLOR_1=1 COLOR_2=4. Convert data into for example GML if you want to preserve list attributes.
    – user30184
    Commented Aug 8, 2021 at 14:59

1 Answer 1

1

I downloaded some test data from https://ienccloud.us/ienc/products/files/u37/ienc_s57/U37UM723.ZIP

Test 1 with OGR_S57_options

ogr2ogr -f "ESRI Shapefile" wrecks01.shp U37UM723.000 wrecks --config OGR_S57_OPTIONS "LIST_AS_STRING=ON"
Warning 1: The output driver does not natively support StringList type for field LNAM_REFS. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type StringList on shapefile layers.
Warning 1: The output driver does not natively support IntegerList type for field FFPT_RIND. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type IntegerList on shapefile layers.

Test 2 without OGR_S57_options

ogr2ogr -f "ESRI Shapefile" wrecks02.shp U37UM723.000 wrecks
Warning 1: The output driver does not natively support StringList type for field LNAM_REFS. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type StringList on shapefile layers.
Warning 1: The output driver does not natively support IntegerList type for field FFPT_RIND. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type IntegerList on shapefile layers.
Warning 1: The output driver does not natively support StringList type for field QUASOU. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type StringList on shapefile layers.
Warning 1: The output driver does not natively support StringList type for field STATUS. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type StringList on shapefile layers.
Warning 1: The output driver does not natively support StringList type for field TECSOU. Misconversion can happen. -mapFieldType can be used to control field type conversion.
ERROR 6: Can't create fields of type StringList on shapefile layers.

With LIST_AS_STRING=ON option ogr2ogr prints less warnings so obviously the variable works. I do not know why all the warnings are not removed but my test data was not best possible because it does not contain any data for the stringList/integerList attributes.

2

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.