They represent the areas of the statistcal districts of Linz, Austria. I want to them into line segements, where each line segment expands from one intersection to the next intersection of a the district's boundary nodes.
These line segments finally should be exported into a .shp or even better into a .gpx File (QGIS-lines should be tracks and trackpoints within the .gpx).
The reason is, I want to import this .gpx into JOSM, an editor for OpenStreetMap, to use them for creating and improving boundaries (in this example the districts of Linz). Therefor the lines have to be split from intersection to intersection as I explained above.
Now to my question: How to do this mostly automatically using QGIS? I already found out how to do it with several manual steps. But that's not very comfortable if the number of source polygons is much higher compared to the 16 of Linz.
My steps are:
- Add Vector Layer, choose .gml file
- Vector > Geometry tools > polygons to lines
- Toolbox > Grass > v.clean: "bpol"-tool
- now most of the line-segements are created but still there are some individual lines, sharing the same start/end-vertex which should belong to to the same segement, for example the node on the bottom right (see Screenshot 2)
- manual selection of 2 lines, Toggle Editing, Merge Selected Features
- click on vector name, Save as..., .GPX, next dialog: Layer name= "tracks" (to create a GPX-track with trackpoints instead of single waypoints or Routepoints)
The lines should be split at each corner (= where the line contacts with at least 2 other line segments). And there shouldn't be overlappping duplicate line segements above each other in the resulat, the duplicates should be removed.