I’ve been mapping railways in OSM for at least a decade, including collaboration and consultation with other mappers both in my state (California), country (USA), an author of OpenRailwayMap (several excellent internationally-viable overlay layers for OSM rail data), dozens of state-level rail wikis, our US national rail wiki, a “North American” rail wiki and an SOTM-US “Lightning Talk” I gave on rail.
In the USA / North America, we have similar rail “agglomerations” in a large / long sense, but our “structure” of rail as entered into OSM differs slightly from that in Europe, especially Germany. Briefly, Germany and parts of Europe (last I checked) use three types of relations to aggregate rail, route=tracks
, route=railway
and route=train
. In the USA and North America (and other parts of the world?) we use three also, but different ones: two mostly and one rarely. (The rare one is a super-relation of routes). We conflate route=tracks
into route=railway
(never using tracks), so route=railway
become what in the USA are known widely as “Subdivisions” (of rail routes), and we of course also use route=train
to denote passenger rail routes. Additionally, we (rarely) aggregate a collection of subdivisions (route=railway
) into a super-relation of route=railway
s, calling this a “Major Mainline Rail.” Examples include the Northern Transcon(tinental) and Southern Transcon, in addition to “regional corridors” like Crescent Corridor and Mid-America Corridor (“large freight corridors” as I believe you mean). See United States/Railroads - OpenStreetMap Wiki. After many years of most of a continent “doing” rail like this in OSM, we don’t see any problems (displaying, routing…rail elements or relations) with eliminating route=tracks
relations. Really, this is about harmonizing “how a country” (or so) crafts rail into “routes” and aggregating these into data structures that are agreeable to OSM, its systems and its data authors (volunteer contributors). This has evolved over time, and like I say, differs a bit from country to continent, but you certainly have conventions in doing this where you are mapping.
Accordingly, because of this hierarchy of relations, USA’s rail relations contain sensible numbers of elements (railway=rail
). They aren’t all <300 elements, (some rarely go to >2000 or more, we try to minimize these), but 18K is simply too big.
I think something like a sensible super-relation is what the OP is trying to get at. Rather than 18K members (an anomaly for any rail data in OSM), @La_Voie_de_la_Raison likely wants to follow his country’s/region’s “rail relation aggregation conventions” and make a sensible super-relation (or nested set of them). OSM has the super-relation data structure for precisely this reason (among others): so that “base level” relations do not get completely unwieldy (18k is unwieldy). We might have relations of relations (a single-level super-relation) and there are double- and even triple-level relations (of nested relations). But in my opinion, such nesting of relations shouldn’t go any further than three or four levels at most.
@La_Voie_de_la_Raison, saying that a national boundary has a large number of elements in the relation is a poor analogy for this: boundaries are quite static data structures in OSM and have other oddities about them (like they are often invisible and directly-by-eyes unverifiable). Nonetheless, we must put them into our map, as a global map without national boundaries wouldn’t fly. But for rail data, countries, rail companies and those responsible for classifying and aggregating the rail find “manageable methods” to craft the pieces of rail together so they don’t need to include 18K members at a single level.
@La_Voie_de_la_Raison, please explore how your country / continent aggregates rail into various levels of relations and super-relations and abide by those conventions. You might continue to do that here in this topic / thread, or you might consult with your (more-local, regional/country-wide) wiki on how rail relations are properly built around you in OSM.
Edit: One more thing (which both is commonplace and might make things easy): for all kinds of routes… road, bicycle, etc., breaking apart the route at a state or country boundary makes a lot of sense. You might find that simply placing the 18K of elements into “single country relations” and then collecting those relations into a super-relation suffices to simplify what you are attempting to do. But again, do try to abide by “local/regional” (country, continental) conventions for how rail is structured in OSM.