Zh-hans:Key:osmc:symbol

From OpenStreetMap Wiki
Jump to navigation Jump to search
osmc:symbol
说明
用作路标或路牌上的路线符号的机器可读表示 编辑此说明
组: properties
用于这些元素
不可用于节点不可用于路径不可用于区域可用于关系
需要
常用组合
另见
状态:实际使用
本页面由 AI 从英文页面翻译而来,内容需要人工复核。

osmc:symbol=* 是 symbol=* 的机器可读等价物,两者都描述用作路标或路牌上的路线符号

徒步路径符号的机器可读描述

这个渲染器专属标签是为在 OSMC Reit- und Wanderkarte 上自动渲染徒步和骑行路线符号而发明的,并被用于 Garmin 地图的 OSMC 地图生成器所理解。其思路是用不同的输入图形和文本组件来组合出符号。该标签旨在供渲染软件读取,因此它是对 symbol=* 标签的补充而非取代,后者应包含符号的人类可读描述。
该键的标注一直在稳定增长,并且似乎已超出最初渲染器专属的用途。相反,它被通用地用于对任何渲染器的任何步道标记符号进行机器可读描述。

该标签的基本语法为:

osmc:symbol=waycolor:background:foreground:foreground2:text:textcolor

其各子部分为:

  • waycolor - 路线路径本身应绘制成的颜色名称。(请注意,OSMC 地图上不允许使用白色。)
  • background - 描述符号背景的图形。对大多数符号来说,简单的单色背景就足够了,但也允许更复杂的图案。(例如:使用 "white" 表示简单的白色背景)
  • foreground (可选) - 符号的主要图形,通常是一个几何图形加一种颜色,例如 "blue_bar"。该图像将叠加在背景图像之上,因此应当是部分透明的。如果使用文字符号,此字段可以为空。
  • foreground2 (可选) - 可以使用第二个前景图像来描绘多色标记或重复该符号。
  • text (可选) - 在符号上打印的文字。不需要时可以省略此项和 textcolor。为正确渲染,其长度不应超过 3 个字母。最好只使用简单字母,某些工具可能不支持特殊的 ANSI/UTF-8 字形,并会产生大不相同的结果。
  • textcolor (可选) - 打印文字所用颜色的名称。如果使用了 text,则应始终出现此项。

子部分可以留空,或在不需要时省略。最低配置是一个 waycolor,以及一个 foreground 或一些 text,再加上一个 background。

对可能组合的限制

这种非常灵活、带有许多可选部分的基本语法存在一些问题,这些问题已被讨论过多次。例如,并不总能清楚地分辨给定部分是前景还是文字。

因此并非每个工具都支持所有可能的组合,例如在 Waymarked Trails 中,background 子部分不得省略(但可以留空),并且 text 之前必须始终有一个(可以为空的)foreground 子部分。

为了使 osmc:symbol 的取值能够在尽可能多的地图上被正确理解并以相似方式渲染,曾提议遵循以下受限语法,截至 2025 年 6 月,所有已知工具都支持该语法:

waycolor:background[:foreground[:foreground][:text:textcolor]]]

由此产生以下首选选项:

waycolor:background 
waycolor:background:foreground 
waycolor:background:foreground:foreground2 
waycolor:background:foreground:text:textcolor 
waycolor:background:foreground:foreground2:text:textcolor

为使命名描述的各部分能够被唯一识别,省略了“有 text 而无 foreground”这一缺失的选项。请注意,这不会造成任何限制,因为可以添加一个空的 foreground:

waycolor:background::text:textcolor

在现有对象上可能会发现其他组合,并且各种应用可能会(部分)支持它们。

示例

为了对渲染器真正有用,各子部分的不同取值数量应保持较少。请始终先尝试用现有取值来近似你的徒步路线符号。如果你需要一个经常使用的符号,可以在讨论页上提出建议。 不要仅仅因为 osmc:symbol 在地图上好看就把它添加到徒步路线上。osmc:symbol 应始终反映用作路标或路牌上用于指路的路线符号。

取值

waycolor

标签背景

simple round circle frame
     black black black_circle
     blue blue blue_circle
     brown brown
     green green green_round green_frame
     orange orange
     purple purple
     red red red_round red_circle red_frame
     white white white_round white_circle
     yellow yellow yellow_circle yellow_frame

标签前景

Shape blue yellow red green black white orange
arch red_arch black_arch white_arch
backslash yellow_backslash red_backslash green_backslash
bar blue_bar yellow_bar red_bar green_bar black_bar white_bar orange_bar
bowl blue_bowl yellow_bowl green_bowl
circle blue_circle yellow_circle red_circle green_circle black_circle white_circle
corner blue_corner yellow_corner red_corner green_corner white_corner
crest red_crest black_crest
cross blue_cross yellow_cross red_cross green_cross black_cross white_cross
diamond blue_diamond yellow_diamond red_diamond green_diamond black_diamond white_diamond
diamond line white_diamond_line orange_diamond_line
dot blue_dot yellow_dot red_dot green_dot black_dot white_dot orange_dot
drop red_drop
drop_line red_drop_line green_drop_line
fork blue_fork yellow_fork red_fork green_fork black_fork
hiker hiker white_hiker
horse green_horse black_horse
L blue_L yellow_L red_L green_L
lower blue_lower yellow_lower red_lower green_lower white_lower
pointer blue_pointer yellow_pointer red_pointer green_pointer black_pointer white_pointer
rectangle blue_rectangle yellow_rectangle red_rectangle green_rectangle black_rectangle white_rectangle
rectangle line yellow_rectangle_line black_rectangle_line white_rectangle_line
red diamond black_red_diamond white_red_diamond
right blue_right yellow_right red_right green_right black_right white_right orange_right
slash blue_slash yellow_slash red_slash green_slash
stripe blue_stripe yellow_stripe red_stripe green_stripe white_stripe
triangle blue_triangle yellow_triangle red_triangle green_triangle black_triangle white_triangle
triangle line green_triangle_line black_triangle_line white_triangle_line
triangle turned blue_triangle_turned red_triangle_turned green_triangle_turned
turned T blue_turned_T yellow_turned_T red_turned_T green_turned_T white_turned_T
x blue_x yellow_x red_x green_x white_x

其他形状

  • shell_modern
  • shell
  • ammonit
  • mine
  • heart
  • tower
  • wolfshook

标签文字颜色

black blue brown green orange purple red gray white yellow

显示 osmc:symbol 的地图

工具

这些是用于在不上传到 OSM 的情况下测试 osmc:symbol 标注的基于网络的工具:

可能的标注错误

这个 Overpass 查询会找出一些可能在 Waymarked Trails 中无法使用的 osmc:symbol。

参见

  • symbol=* - 用作路标或路牌上的路线符号的人类可读描述
  • wiki:symbol=* - 徒步路径符号的 OpenStreetMap Wiki 符号参考
  • trailblazed=* - 户外路径和步道上通过标志、标记、柱子、石堆或其他方式所作的标记
  • information=guidepost - 用于标记路牌/指路牌
  • colour=* - 与对象关联的颜色