Sorry for the late response.
First you need to make sure you only have single part polygons using sf.ExplodeShapes: http://www.mapwindow.org/documentation/mapwingis4.9/group__shapefile__geoprocessing.html#ga5d7fa6b688d294b3a236537b07a72ea1
The difference between a polygon and a polyline is that the last and first points of a polygon are the same.
You need to figure out how to handle donut shaped polygons (polygon with a hole).
Probably the easiest part is to create a zero buffer (http://www.mapwindow.org/documentation/mapwingis4.9/class_shape.html#ad4063312b170dcee5f6065b3dfcef0d9) around your polygon to get the outline and add all points except the last one to a new polyline shape.
Using Utils.ogr2ogr (http://www.mapwindow.org/documentation/mapwingis4.9/class_utils.html#a269f6ab098480f14202a530d7e278407) might also work with the -nlt (http://www.gdal.org/ogr2ogr.html) option.
Regards,
Paul
First you need to make sure you only have single part polygons using sf.ExplodeShapes: http://www.mapwindow.org/documentation/mapwingis4.9/group__shapefile__geoprocessing.html#ga5d7fa6b688d294b3a236537b07a72ea1
The difference between a polygon and a polyline is that the last and first points of a polygon are the same.
You need to figure out how to handle donut shaped polygons (polygon with a hole).
Probably the easiest part is to create a zero buffer (http://www.mapwindow.org/documentation/mapwingis4.9/class_shape.html#ad4063312b170dcee5f6065b3dfcef0d9) around your polygon to get the outline and add all points except the last one to a new polyline shape.
Using Utils.ogr2ogr (http://www.mapwindow.org/documentation/mapwingis4.9/class_utils.html#a269f6ab098480f14202a530d7e278407) might also work with the -nlt (http://www.gdal.org/ogr2ogr.html) option.
Regards,
Paul