0

When I try to save algorithm output to MapInfo's .tab file format, I get a feature write error for every feature in the output. This does not happen for .shp output. The error is:

Feature could not be written to C:\Users\nganj\Desktop\TEST/EN/MapInfo/Eligible_Transport_Communities.tab: Feature creation error (OGR error: Failed writing attributes for feature id 1 in C:\Users\nganj\Desktop\TEST/EN/MapInfo/Eligible_Transport_Communities.tab)

outfile = parameters['DESTINATIONFOLDER'] + "/EN/MapInfo/Eligible_Transport_Communities.tab" 
    alg_params = {
        'FIELDS_MAPPING': [{'expression': parameters['ETCCOMMID'],'length': 0,'name': 'Eligible_Community_Number','precision': 0,'type': 2},
        {'expression': parameters['ETCNAMEEN'],'length': 150,'name': 'Eligible_Community_Name_en','precision': 0,'type': 10},
        {'expression': parameters['ETCNAMEFR'],'length': 150,'name': 'Eligible_Community_Name_fr','precision': 0,'type': 10},
        {'expression': parameters['ETCPROVINCE'],'length': 2,'name': 'Province_Territory','precision': 0,'type': 10},
        {'expression': parameters['ETCLATITUDE'],'length': 0,'name': 'Latitude','precision': 6,'type': 6},
        {'expression': parameters['ETCLONGITUDE'],'length': 0,'name': 'Longitude','precision': 6,'type': 6},
        {'expression': parameters['ETCSATDEP'], 'length': 15, 'name': 'Satellite_Dependent', 'precision': 0, 'type': 10}],
        'INPUT': parameters['EligibleTransportCommunities'],
        'OUTPUT': outfile
    }outputs['RefactorETCToEnglishLong'] = processing.run('native:refactorfields', alg_params, context=context, feedback=feedback, is_child_algorithm=True)

What am I doing wrong ?

1 Answer 1

0

Found it. The field length for the double types need to be >0

Your Answer

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

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