I need to export a district border from OSM to GeoJSON. I made a program that extracts borders as LineStrings from OSM XML and saves it as GeoJSON file. Now I need to merge LineStrings into a Polygon or MultiPolygon. Is there a tool that can do it?
P.S. I tried to made a polygon directly from OSM XMLs but some lines there has reverse order of points and result looks bad.