Zh-hans:Relation:route

From OpenStreetMap Wiki
Jump to navigation Jump to search
Public-images-osm logo.svg route
CycleLayer2.png
说明
用来描述各种路线. 编辑此说明
组: routes
成员

  • way - <empty>
  • way - forward
  • way - backward
  • node - stop
  • node way area - platform
  • node - guidepost
常用组合
另见
状态:实际使用

一条 路线 (route) 是指一条常用的通行线路或旅行线路, 一般是被确定并被公布出来的. 路线由人和车辆反复通行所经过的路径所组成: 北大西洋航线上的一艘船,有编号的公路上的一辆车,公交线路上的一辆公交车或者国道上的骑行者.

一条路线 (或者变体) 可能属于一条主路线 (route master) 关系,主路线关系应当包含该条路线的所有方向、变体路线及其信息。这将会使得OSM可以区分旅行路线的两个方向。

注意,一个路径有时同时具备多个编号。许多主要的欧洲"E"路线 与国道共享同一条路径 (有时甚至完全相同) 。

按照这种方案所渲染的骑行路线 (cycle routes)
按照这种方案所渲染的有轨电车及公交路线(bus routes)
Rendered walking routes following this scheme

标签

要求 解释
type ! Required route 代表此关系是路线关系
route ! Required road / inline_skates / evacuation / detour / bicycle / mtb (mountainbike) / foot / hiking / running / bus / trolleybus / ferry / canoe / train / railway / tracks / tram / horse / ski / snowmobile / piste 一条道路 (比如,构成A7公路的方式) ,骑行路线,徒步路线或者其他任何路线 (具体类型请参阅 #Route types (route)).
name  Important 它的名称 这条路线的名称 (比如 Jubilee Cycle Route, Pembrokeshire Coastal Path).
ref  Important 一个编号 这条路线所具备的编号; 比如, A7, NCN 11, Citi 4. 如果关系没有父关系route_master=*,这个标签是必备的,否则是可选的。
network  Important ncn / rcn / lcn / nwn / rwn / … 一个更广泛的线路网络。例如,英国全国的骑行线路网络或某地的骑行线路网络.
direction ? Optional north / south / east / west 在加拿大、新西兰和美国,两个方向都被official cardinal direction 映射为 superrelation 中的单独一条关系时,需要标注官方的线路方向.
operator ? Optional 运营方名称 路线运营方,一般由当局或公司等运营,比如

Stagecoach Cambridge, Eurostar.

state ? Optional proposed 计划/ alternate 备用/ temporary 临时/ connection 连接 有时线路可能临时变化 (即临时改道绕行),或者线路处于计划状态 (比如,英国NCN线路有时不是官方公布的线路,还在讨论或准备过程中) 。connection用于连接两条不同路线或将线路连接到例如村镇中心等位置。
symbol ? Optional Symbol description 用于表述标记该线路的符号;比如德国Franconia地区的 Frankenweg 中的 Red cross on white ground.
colour ? Optional A color name or a hex triplet 颜色以 hex triplet 格式标注。对于公共交通路线尤其有用。例如:

#008080 表示一种蓝绿色.

description ? Optional 简短的描述 这条路线的特殊之处.
distance ? Optional 距离 路线范围内的名义上的距离。用来供用户参考并自动评估;例如:线路的完整性. 默认单位是公里,使用小数点分隔整数和小数。如果指定单位,应将单位与数字之间用空格分开,同时使用 Units 页面中所述数值.
ascent ? Optional 上升 线路覆盖范围内海拔上升 (默认单位是米;其他单位需要明确指定), 如果一条路线起点与终点高度有落差,也请使用下降 (ascent).
descent ? Optional 下降 线路覆盖范围内海拔下降 (默认单位是米;其他单位需要明确指定)。仅在它与ascent (即路线起点与终点的高度不同) 不相符时,才使用下降 (descent).
roundtrip ? Optional yes/no 路线是否在同一位置开始和结束;也就是说路线是否包含往返路程,最终回到起点.
interval ? Optional 公共交通路线中任意一个站点的发车间隔时间. 这个标签仅适用于公共交通路线. 使用 HH:MM:SS, H:MM:SS, HH:MM, H:MM, MM, 或者 M 的格式. 例如: 可以将 interval=00:12:30 添加到每12分30秒一班列车的地铁线路中.
duration ? Optional 公共交通路线上从第一站到最后一站所经过的时间. 这个标签仅适用于公共交通路线. 使用 HH:MM:SS, H:MM:SS, HH:MM, H:MM, MM, 或者 M 格式. 例如: 可以将 duration=00:42 添加到从开始到结束,全程耗时42分钟的地铁路线中.
tourism ? Optional yes 如果线路尤其吸引游客的话.

成员

Way/node 角色 Recurrence 描述
way Role ! 1+ 组成线路的方式。目前应角色为空,而非 Role route 这种常用于 PTv1的角色。
way Role forward/Role backward ? 0+ If a route should be followed in only one direction for some or all of its length, the role can indicate this for some or all of the constituent ways. Role forward means the route follows this way only in the direction of the way, and Role backward means the route runs only against the direction of the way. Rendered on the cycle map (example).

不能用于公共交通路线关系中 (应使角色为空).

way Role north/Role south/Role east/Role west ? 0+ In Canada, New Zealand, and the United States, the a role set to a cardinal direction indicates which of the route's official route directions the way carries when the route is mapped as a single bidirectional relation.
way Role hail_and_ride ? 0+ This role should only be used on public transport routes.

Used on road segments in a public transport route relation where you can stop a vehicle at any point to get on or off. Common in asian countries.

way Role reverse ? 0+ On some roads way, a bus has to reverse its way out of cul-de-sac. To reflect this in a route relation, use this role on a road segment.

This role should not be used anymore on public transport routes (put the way in the route relation twice instead).

way Role link ? 0+ Link roads (highway=*_link) from and to the route. See highway=motorway_link. Note: this is at best extremely dubious, or maybe always unwanted. In many cases, maybe all, adding link roads from and to the route is incorrect.
node Role stop ? 0+ 仅适用于公共交通路线中.

属于公共汽车路线或火车路线 way 中的一员. 在关系中成员应当按照时间顺序前后排列。 目前请使用Role stop 角色,而非Role stop:<number>, Role forward:stop:<number>, Role backward:stop:<number>, Role forward:stop, Role backward:stop 这类常在PTv1中用来帮助查找车站位置错误或车站缺失的角色。

node way area Role platform 站台 ? 0+ Platform仅适用于公共交通路线中.

一个公共汽车站或火车站台应当属于线路的一部分。成员们在关系中要按时间顺序前后排列。 目前,请使用Role platform 角色,而不要使用 Role platform:<number> 这类常在PTv1中用来帮助查找站台位置错误或站台缺失的角色。

node Role guidepost ? 0+ A guidepost which refers the route. See information=guidepost.
node Role milestone ? 0+ (signed) kilometre, mile, leg, etc.
node area relation Role information ? 0+ Information board, information stand about the route (and only the route).
node way area * All commonly used values according to Taginfo

Note: to ensure a route is properly connected when using a two alternative directions (alternative route A1 and A2, using the Role forward and Role backward roles), make sure the element before the branch connects to the first element in A1 and the element after the branch connects to the last element of A2. Also note that the Role forward and Role backward roles refer to the directionality of the ways in A1 which need to be going in the same direction; if not all ways in A1 run in the same direction it may be necessary to use both Role forward and Role backward for the same alternate route A1.

路线类型 (route)

下表中按字母顺序排列,来自于地图要素#Route, 包含了最常用的关键词。更多的路线类型和不常用的关键词,请参见Key:route.



Key Value Element Comment Rendering Photo
route bicycle relation Cycle routes or bicycles route are named, numbered or otherwise signed. May go along roads, trails or dedicated cycle paths
Ystadstartingpointcykelsparetostkusten06040011.png
route bus relation The route a public bus service takes. See Buses.
EDS-FullLED-Mobitec.JPG
route canoe relation Signed route for canoeing through a waterway.
Canoe route lkn.png
route detour relation Route for fixed detour routes. Examples are Bedarfsumleitung in Germany and uitwijkroute in the Netherlands Zeichen 463 - Bedarfsumleitung (rechts), StVO 1970.svg
route ferry way relation The route a ferry takes from terminal to terminal Please make sure to add at least one node per tile (zoom level 12), better at least one every few km, so offline editors catch it with bbox requests.
Route ferry.png
Ferry.Viking.line.mariella.800px.jpg
route foot relation Walking Route - is used for routes which are walkable without any limitations regarding fitness, equipment or weather conditions.
State Foot2.svg
route hiking relation Hiking explains how to tag hiking routes.
Hærvejen vandretureskilt.jpg
route horse relation Riding routes
Hawick Circular Riding Route - geograph.org.uk - 592357.jpg
route inline_skates relation Inline has more information on the subject.
Signalisation Skatingroute.svg
route light_rail relation Route of a light rail line.
S-Bahn Berlin Baureihe 481.jpg
route mtb relation Mountain biking explains how to tag mtb routes.
Mountain bikers this way^ - geograph.org.uk - 744534.jpg
route piste way relation Route of a piste (e.g., snowshoe or XC-Ski trails) in a winter sport area.
Snowshoe trail.jpg
route railway relation A sequence of railway ways, often named (e.g., Channel Tunnel). See Railways.
08 tory railtrack ubt.jpeg
route road relation Can be used to map various road routes/long roads.
2014-05-16 15 58 16 Sign for Interstate 95 northbound on Interstate 95 in Ewing, New Jersey.JPG
route running relation For running (jogging) routes.
Laufarena.at2.jpg
route ski relation For ski tracks (e.g., XC-Ski Trails User:Langläufer/Loipemap).
Langlauf Loipe.jpg
route subway relation Route of a metro service
Ubahnlogo.svg
route train relation Train services (e.g., London-Paris Eurostar) See Railways.
Transports Publics du Chablais - Zuglaufschild - 01.jpg
route tracks relation Railroad track as rail infrastructure.
08 tory railtrack ubt.jpeg
route tram relation See Trams for more information on tagging tram services.
Cobra3058.JPG
route trolleybus relation The route of a trolleybus service.
Trådbuss Landskrona.JPG
route User defined relation All commonly used values according to Taginfo.

This table is a wiki template with a default description in English. Editable here.

公共交通路线

主条目:Public transport

所有的公共交通关系都由以下关键字和值组合而成:

关键字 要求 评论
type ! Required route
route_master
route
route_master
! Required bus
trolleybus
minibus
share_taxi
train
light_rail
subway
tram
ferry

由于公共交通在OpenStreetMap中是一个相当复杂和有争议的话题,因此本节仅仅是最基本的要求,这也有助于保持最新状态并避免wiki中的内容冲突。有关详细信息,请参阅Public transport

公路路线

主条目:Key:network
主条目::Category:Tag descriptions for key "network"
route路线 network网络 描述
road e-road European E-road network
road AR:national Argentine national roads
road AR:provincial Argentine provincial roads
road by:national [1] Belarusian Road Network - national roads
road BR Brazilian Federal Highways
road BR:xx Brazilian state highways, where xx is replaced by a state code (RJ = Rio de Janeiro, MG = Minas Gerais, etc.)
road bg:national Bulgarian Road Network - national roads
road ca_transcanada Canadian Trans-Canada highways
road ca_on_primary Ontario primary highways
road BAB German Autobahn
road GH:national Ghana Road Network - national roads
road GH:inter-regional Ghana Road Network - inter-regional roads
road GH:regional Ghana Road Network - minor & major regional roads
road gr:national Greek national roads
road gr:provincial:nn Greek provincial roads, where nn is the prefecture's ISO code.
road HK Hong Kong Strategic Routes
road HU:national Hungarian expressways and main roads
road JP:national Japanese national roads
road JP:prefectural Japanese prefectural roads
road na Namibian roads
road NL:A The motorway network in the Netherlands (A-roads).
road NL:N The non-motorway network in the Netherlands (N-roads).
road NL:S:city The city route network in the Netherlands (S-roads), where city is the city.
road NL:R:network The recreational road network in the Netherlands (R-roads), where network is the network name.
road ph:nhn Philippine national highway network
road PK:national Pakistan National Highway network
road PK:motorway Pakistan Motorway network
road PK:Province Pakistan Provincial or Territorial network (example: PK:Punjab:LRR for Lahore Ring Road. This has it's own network subtag as it is not part of the main Punjab provincial network, and uses the common acronym rather than the name Lahore to avoid confusion with the city of Lahore as an operator)
road pl:national Polish Road Network - national roads
road ro:DN Romanian Road Network - national roads
road ru:national Автодороги России - Russian national roads
road ua:national Ukrainian national roads
road US:I Interstate Highways Relations, USA
road US:US United States Numbered Highway Relations, USA
road US:xx State highways in the United States, where xx is the state's postal abbreviation. Many states also have county route networks, and some have several tiers of state-owned roads.
road VE:T:xx "Troncal" roads in Venezuela, where xx is the state's name abbreviation, according to the INTT's standard
road VE:L:xx "Local" roads in Venezuela, where xx is the state's name abbreviation, according to the INTT's standard
road VE:R:xx "Ramal" roads in Venezuela, where xx is the state's name abbreviation, according to the INTT's standard
road za:national South African national roads
road za:regional South African regional roads

绕行

route Description
detour Local detours (used in the Netherlands and Germany). Detours are routes that avoid traffic jams on motorways, usually leading from one exit to the next.

自行车路线 (也包括山地车)

主条目:Cycle routes
Key Presence Value Description
route ! Required bicycle / mtb Use "bicycle" or "mtb", but not "bicycle/mtb"
network ! Required for route=bicycle

? Optional for route=mtb

Specify the network as a international route, national route, a regional route or a local route, as per the normal tagging of cycle routes
icn International cycling network: long distance routes used for cycling routes that cross continents.
ncn National cycling network: long distance routes used for cycling routes that cross countries.
rcn

Regional cycling network: used for cycling routes that cross regions.

lcn Local cycling network: used for small local cycling routes. Could be touristic loops or routes crossing a city.
ref ? Optional Official reference The reference number/ID found on signposts etc.
state ? Optional proposed Routes are sometimes not official routes, pending some negotiation or development. Maps may choose to render these routes differently; e.g., as dotted lines.

示例:

步行路线 (也包括远足和朝圣)

主条目:Walking Routes

Hiking routes are extensively mapped with route relations, and the Waymarkedtrails map will render route relations following this proposal and the osmc:symbol=*

Hiking routes are rendered for selected areas in Germany in a hiking and trail riding map (German). The tags required for rendering are:

Key Presence Value Description
type ! Required route
route ! Required hiking Typically longer or more strenuous routes, usually on unpaved paths.
foot Typically easier routes, usually on paved surfaces.
network ! Required iwn International walking network: long distance paths used for walking routes that cross several countries, for example the Camino de Santiago
nwn National walking network: long distance paths used for walking routes that cross countries
rwn

Regional walking network: used for walking routes that cross regions.

lwn Local walking network: used for small local walking routes. Could be touristic loops or routes crossing a city
name  Important Meaningful route name suitable for identifying this route.
symbol ? Optional Verbal description of the route marker symbols.
osmc:symbol ? Optional Coded description of the route marker symbols.
pilgrimage ? Optional yes / no Whether the route is used for pilgrimage. This qualifies the use of a hiking/foot route; as opposed to creating a new route type with route=pilgrimage.

轮滑路线

主条目:Inline skating

Inline Skating routes have been mapped mainly in Switzerland EN:Switzerland/InlineNetwork and the Netherlands with route relations. Lonvias Skating map will render such routes.

Key Presence Value Comment
route ! Required inline_skates
network ! Required international / national / regional / local Specify the network as a international route, national route, a regional route, or a local route
ref ? Optional Reference References work best on the map if just the number is used, so for national 4: 4. The network tag correctly distinguishes the type, so just use ref.
state ? Optional proposed Routes are sometimes not official routes pending some negotiation or development; the map renders these routes as dotted.

Some examples in use:

其他

This is a table with possible route tags being used right now:

route Description
evacuation Emergency evacuation routes
fitness_trail For a fitness trail with extra exercise stations
horse See also riding
inline_skates Inline skate routes are named or numbered or otherwise signed routes for inline skating.
running Used for marked running routes, usually 2–20km, that are used for exercise
snowmobile For snowmobile routes. Either between two destinations or a collection of routes operated by someone
taxi See also: route=share_taxi
trolleybus See bus
cycling Used for cycling events (like stages of the Tour de France). For (recreational) cycle network use bicycle
historic Historic routes, such as horse-pack trails used for postal routes, ancient roads, etc. Often parts are lost. Please include an appropriate historic=*-value.
motorcycle Used for motorcycling events (motorcycle rally, guided tours)
transhumance For long distance livestock paths
waterway A route via navigable waterways, suitable for commercial shipping or recreational boating
worship A route along which fixed points of worship are placed, e.g. a via Crucis.

如何绘制

多条路线共享同一条路径

Especially with bicycle routes, often multiple routes run along the same ways for a far distance. There exist so many different bicycle route networks that are operated by different entities that it is not unusual that some of these networks overlap. The EuroVelo routes, for example, use the existing infrastructure in many countries. There are two practices at the moment, if segments of multiple routes share the same way.

  • Add the ways to all relations of the routes that they belong to.
  • Split the routes into part relations and make super relations (relations that don’t contain ways but instead other relations). Then add the segment that is shared by the routes to all of them.

Both practices each have advantages and disadvantages.

向多个线路关系添加路径
  • When many routes share one path, it can be a lot of work to map a new part of the route, because you have to add the ways to all relations.
  • People might not see that the path also is used by other routes and might forget to apply their changes to all relations. Thus the data may become inconsistent.
  • This is probably the easier way, as it is somewhat hard for beginners to split relations into parts and to find out which part they have to edit.
  • Relations might become very big, which makes it hard to work with them (analyzers need more time to process them, drawing them into the map will take a lot of JavaScript CPU time).
  • If you don’t use super relations at all, you also have to add alternative routes and excursions to your relation. This makes it hard for analyzers and tools to understand the route. Role=excursion and role=alternative have been suggested, but they still don’t say which way belongs to which excursion (if there are multiple ones).
  • It is the purpose of relations to group objects. When two primary roads share the same street at some section, we don’t create two ways that share the same nodes. So we shouldn’t create two relations that share the same ways.
为路线创建Super-relation
主条目:Superrelation
  • Current renderers (like the CycleMap) don’t support super-relations, so they don’t show the ref and the network tag of a super-relation. Currently, all these tags have to be added to all part relations, which is a lot of work (especially as the parts need to have the different refs of all the routes they belong to).
  • It is said to be good mapping practice to keep relations one way. So alternative routes and excursions need to be put into a different relation. So you often need a super-relation even without splitting the route into parts.
  • Tools and analyzers (like the OSM Relation Analyzer, especially the GPX export function) don’t support super-relations yet. This makes it hard to analyze a route as a whole (which is important, for example, to calculate how much of a route already has been mapped). (Note: OSM Route Manager supports subrelations)
  • There is no documented convention on how to handle super-relations. On first glance it appears simple--just take over all tags to all members--but it is not. There are tags where this makes no sense or which change the context and meaning when handed over to a member relation; e.g., distance or note. The same applies to roles other than in base relation, e.g. forward/backward.
  • Super-relations can become very confusing when a relation belongs to multiple super-relations or a way belongs to multiple relations. In that case it is no longer deterministic from which relation a certain relation or way will receive its tags.
  • When someone maps a new route, they might have to split other routes that share ways with it. People editing these other routes might get confused when the number of subrelations keeps changing the whole time.
  • Current editors miss advanced relation editing features, such as “Split relation” (and also super-relation rendering). Things can get very confusing when one route consists of hundreds of small part relations.
  • One motto of OSM is "Don't map for the renderers". If it is considered the more natural way of mapping to create super-relations, then the missing support in the renderers and tools should not stop us from doing so.
  • Consider that super-relations are not necessarily included when requesting a set of data from the server. So depending on whether or not super-relations were included, the data is interpreted differently. As you cannot tell from a way or relation whether it is member of another relation, you never are quite sure whether you are seeing all the relevant data.
  • It is common sense to create super-relations if one complete route is part of another route (like the German D6 is with EuroVelo EV6). If EV6 now shares only a part of another way in another country, we will have to create segments anyway (else we end up with a relation that contains both sub-relations and ways). We should either use the one method or the other.
  • People need to know only the route that they are mapping. When someone maps the German D6 route, he doesn’t even need to know the EuroVelo network (as EV signs might not exist in his area), because, as with a super-relation, his part of the route gets added automatically to all parent relations. This fits the OSM concept better: When everyone maps the places and things he knows, a complete map of the world evolves.

At the moment it seems to be practice to create part-relations, if the shared segment is relatively big compared to the total length of a route. For a national bicycle route, 20 km might be a good limit. For shorter parts the single ways might be added to all relations they belong to. (Of course this is only a rule of thumb. Nothing of this is the official way of mapping.) It also might be important how many different way objects a segment consists of in OSM. It might be not very useful to create segments, if the route consists of motorways (as they only contain of a few, long ways), while bicycle routes often go through cities and residential areas where many ways would have to be added if there were multiple relations.

Another point when deciding which tagging method to use is to find out if the routes use the same ways only by coincidence. Thus, if one route is changed, the other route likely still will be using the old way, so using part-relations would not be appropriate.

大小

Common practice is not to create route relations with more than 250–300 members. If you need to create bigger relations, which could happen easily, make several reasonable-sized relations and unite them in a super-relation as mentioned above. Reasons:

  • Keep the relations editable.
  • Avoid conflicts. The bigger the relation the more likely it is that two users are working on it at the same time.
  • Save the server resources.

There is also a list of Monster Relations.

公交巴士路线和环线

Bus routes passing through roundabouts are mapped in one of these two ways:

  1. The whole roundabout is included in the route relation.
  2. The roundabout is split and the part used by the bus route is included in the route relation.

There is no consensus among the OSM community regarding which method is recommended. The choice of method 1 or 2 has no effect on Garmin devices because split roundabouts are re-joined by mkgmap. It is also possible to re-join split roundabouts in Mapnik although this is not done for the rendering of the main map. Software developers should note that if the precise route is required and method 1 has been used, the details will need to be deduced from the positions of the entry to, and the exit from the roundabout; and also from the position of a stop, if the bus serves a stop on the roundabout. (In some cases a bus may make more than one full circuit of a roundabout.)

其他事项

For many route relations, members order matters. For instance, an unordered hiking route relation would have a pretty useless, unreadable elevation graph:

Unreadable elevation graph

In addition, data consumers may not be able to understand the path to be followed: one way, then another kilometers away, then back to the end of the first way…

Users editing routes should consequently try to keep them ordered if they are, or order them if they are not. A good hint, for JOSM, is to look at the last column of the members section of the relation editor: if this column has arrows in only one direction, and has no red points between members, then the members are ordered.

On the other hand, unordered relation members make this column display arrows in both directions, isolated members – segments without arrow and with 2 red dots –, and many red dots at continuity breaks.

Please be aware of the fact that some editors cannot handle (PTv2-)relations properly and splitting ways may result in unordered relations (e.g. iD-issues: [1], [2] or[3]).

步骤指南

How to create a new route (it is slightly different if you want to add ways to an existing route).

Potlatch

  1. Ensure all ways that the route runs along exist and are appropriately tagged (e.g., highway=footway)
  2. Select the first way and click on the second symbol on the right side, which looks like two chain segments.
  3. Select a relation from the drop-down menu, if there is an existing relation in this area that is appropriate. If the existing relation you want to choose is far away, use the search function. Otherwise, select Create a new relation and click Add.
    1. Add a type tag with the value route.
    2. Add additional tags as needed. (Use the + button)
    3. Click OK.
  4. The relation has been added to the way. The grey box to the right of the relation details and to the left of the X is the input field for the way's role within the relation. See the Members section above for details of roles within the route relation type.
  5. Repeat steps 2–4, selecting the appropriate relation (the one just created) in step 3.

JOSM

  1. Ensure all ways along which the route runs exist and are appropriately tagged (e.g., highway=footway)
  2. Make sure the relation pane (Alt+Shift+R) is open
  3. Select New in the relation pane to create a new relation
  4. Fill in the appropriate tags in the dialog that pops up, adding at least type=route and preferrably name as well with a name for the route
  5. Click OK
  6. Now select some or all of the ways you would like to add to the relation using the normal select (S) tool, then click Edit in the relation pane with your relation highlighted. The relation editing dialog will pop up
  7. Click Add selection in the relation dialog to add the selected ways to the relation.

关系上的导航:线路

Please list applications here that are able to navigate on an existing relation:route.

  • cycle.travel uses route relations (of type=bicycle and type=road) to influence weighting for route selection.

相关提案

参考文献

  1. ISO_3166-2:BY于维基百科.

参见