[SOLVED] [JOSM] Merging thousands of GPX files?

Hello,

The following OverpassTurbo query to OSM returns thousands of tiny tracks:

[out:json][timeout:25]; 

//Sicily: 39152 
rel(39152);map_to_area -> .searchArea; 

( 
  node["railway"="rail"](area.searchArea); 
  way["railway"="rail"](area.searchArea); 
); 

out body; 
>; 
out skel qt; 

Apparently, JOSM supports merging multiple tracks into a single track, but… how should I do this when thousands of tracks are involved?

Or should I run the query directly from JOSM and have it merge the output somehow?

Thank you.

For others’ benefit: I solved the problem by opening the 2.4MB file in a layer in JOSM, adding a new layer, and drawing each route manually. The few GPX files I ended up with weigh a grand total of… 15KB.

The experts might know of a smarter way, but it only took a few minutes anyway.

For QGIS experts, it appears there are two ways to simplify tracks significantly:

  • Convert the gpx data into a spatial dataset, and dissolve geometries through eg. a train line operator

  • Use the “Join Multiple Lines” plug-in