Module:Road data/strings/CHN

From blackwiki
Jump to navigation Jump to search

This module is used to store type data for use with several road templates, including {{jct}} and {{routelist row}}. Background information and a summary of the syntax are listed below.

Syntax

Hierarchy and fields

At its most basic level, this module is a nested table of strings. At the top is the root table, named for the abbreviation of a country, state, or province. This table stores the type data for a particular place, which is named in the comment in the first line, and is returned at the end of the module. The table is composed of further tables, one per type. The basic syntax for a type table is:

place.type = {shield = "",
              link = "",
              abbr = ""}

The three main fields in a type table are shield, link, and abbr. Generally, shield determines the shield that is displayed, if any; link specifies the target of the link generated by a including module, if any; and abbr determines the displayed abbreviation. Currently, these are the three types used by all countries. By convention, they are always specified, using an empty string if there is no value.

Two additional fields are used in the United States. banner stores the name of the banner file, while width stores a code representing the width of the shield. Unlike the three main fields, these are generally omitted entirely when unused.

Once a type is defined, it can be referred to later in the code. A common idiom used for bannered types is defining the shield to be the shield field of the base type (from Module:Road data/strings/USA/MO):

MO.US = {shield = "US %route%.svg",
         link = "U.S. Route %route% in Missouri",
         abbr = "US %route%",
         width = "expand"}

MO["US-Alt"] = {shield = MO.US.shield,
                link = "U.S. Route %route% Alternate ([dab||%dab%, |]Missouri)",
                abbr = "US %route% Alt.",
                banner = "Alternate plate.svg",
                width = "expand"}

Another common idiom is defining a type alias by setting an entry in the root table equal to a previously defined type (from Module:Road data/strings/HKG):

HKG.Route = {shield = "HK Route%route%.svg",
             link = "Route %route% (Hong Kong)",
             abbr = "Route %route%"}
 
HKG.route = HKG.Route

Parser arguments

When the parser function of Module:Road data/parser is called, it is passed up to three parameters. The second one is the field to parse, and the last one is a rarely-used option designed for multiple-shield types. The first and most important parameter is a table of arguments collected by the calling module, which generally includes the state, country, or both; the type and number of the route; and a few miscellaneous arguments. This table of arguments forms the basis of the parser's format string syntax.

The table accessible by the strings includes the following entries by default:

  • state: The state or province the route is located in.
  • country: The country the route is located in. If the country is not passed by the calling module, the parser will attempt to include it.

The above entries are primarily used to find the string module itself, so they should not be a concern for module writers.

  • type: The type of the route. This determines the entry of the root table that is used by the parser.
  • route: The route "number". This is easily the most important argument for module writers.

The following entries are used less often:

  • county: The county the route is located in. This is usually used for county routes in the United States.
  • township: This entry is similar in function and utility to the county entry.
  • dab: A tag used to disambiguate the link target. This is mostly used for bannered routes in the United States.
  • denom: This rare entry is used exclusively for West Virginia county routes.

Parser hooks, which will be described later, can add entries to this table that may be used by strings.

Basic string syntax

The most basic value that can be used for most type table fields is a specially formatted string, which will be referred to in this documentation as a format string. This is the string that will ultimately be parsed and returned by the parser. A format string is an ordinary string object. The power of these strings comes in the form of two special instructions that are recognized by the parser.

The first is anything in %argument% form. The parser will replace such a statement with the value of the argument entry in the arguments table described earlier. This is what allows the route number to be spliced into a shield or link name.

The second special string is in the form of [arg|equals|then|else]. This functions as a rudimentary if-then-else statement. The parser tests the value of arg to see if it is equal to the value specified in equals. equals may be empty, in which case the parser tests the existence of the arg argument. If the result of the test is true, the statement is replaced with the value of the then block. Otherwise, it is replaced with the value of the else block.

The two statements may be combined. The parser will parse the if-then-else statement first, and then perform the argument inclusion. This combination is commonly used with bannered routes in the United States, where the dab argument is tested and the link disambiguation is adjusted accordingly, as follows (from Module:Road data/strings/USA/AL):

AL["US-Bus"] = {shield = "US %route%.svg",
                link = "U.S. Route %route% Business ([dab||%dab%, |]Alabama)",
                abbr = "US-%route% Bus.",
                banner = "Business plate.svg",
                width = "expand"}

When parsing the link field, the parser first checks to see if the dab argument was provided. If so, it replaces the statement with %dab%, . If not, the statement is replaced with the empty string placed in the else block. Then, the parser replaces %route% with the route number and, if the dab argument was provided, %dab% with the value of that argument.

Switching

Some logic is too complicated to represent with only format strings. This framework provides several methods to express complex data. All of these involve storing a nested table as the value of a field.

The most straightforward functionality provided by nested tables is switching. In its most basic form, the table consists of a series of key-value pairs, with the keys being route numbers and the values being the format strings used by those routes. Usually, the format string returned does not need parsing, but the option is there. A default entry should be provided to handle any route numbers not explicitly stated. The following is a representative example of route-based switching (from Module:Road data/strings/USA/AR):

AR.AR = {shield = {default = "Arkansas %route%.svg",
                   ["917"] = "Arkansas 917-1.svg",
                   ["980"] = "Arkansas 980(Airport).svg"},
         link = "Arkansas Highway %route% [dab||(%dab%)|]",
         abbr = "Hwy. %route%",
         width = "expand"}

In this example, Highways 917 and 980 have non-standard shield names, which are explicitly provided. Other route numbers use the default format.

Switching on other arguments is also allowed. The name of the argument to be used for switching is stated in the arg field of the table. Nesting switches on different arguments is also allowed. A good example that uses both forms of switching can be found in Ontario:

local regionalShields = {arg = "county",
                         ["Essex"] = "Essex County Road %route%.png",
                         ["York"] = "York Regional Road %route%.svg",
                         ["Durham"] = "Durham Regional Road %route%.svg",
                         ["Niagara"] = "Niagara Regional Road %route%.svg",
                         ["Simcoe"] = {["52"] = "Simcoe county road 52.png",
                                       default = "Simcoe County Road %route%.JPG"}}

In this example, which is a shield table that is reused by several types in Ontario, the county argument is used for the primary switch. If the route is in Simcoe County, a second switch is performed, this time on the route number.

Existence testing

Another use for tables is existence testing. If a table has the ifexists field set to true, the parser will perform existence testing on the result of parsing the default field. If the test fails, the result of parsing the otherwise field is returned. Existence testing may be chained by using a second ifexists table as the value of the first table's otherwise field, and so on. Here's an example of nested existence testing (from Module:Road data/strings/GBR):

GBR.B = {shield = {ifexists = true,
                   default = "UK road B%route%.svg",
                   otherwise = {ifexists = true,
                                default = "UK road B%route%.png"}},
         link = "",
         abbr = "B%route%"}

Hooks

Due to technical limitations, these string modules cannot contain functions. Rather than force functionality into the string framework, the parser can call functions in a separate hooks module. The functions in this module, Module:Road data/parser/hooks, are more-or-less fully functional functions. The exact functionalities of these hooks are beyond the scope of this documentation. Descriptions of these hooks may be found on their documentation page.

Generally speaking, a hook is called by setting the hook field in a table as equal to the name of a hook. Hooks receive two arguments, both tables: parameters, which is the table in the definition; and args, which is simply the table of arguments normally passed to the parser. The hook returns a string, which is then parsed as usual. A powerful feature of hooks is that they can add arbitrary values to the argument table, which may be referenced in the string returned by the hook. Generally, the format string returned by the hook is specified in some form by the default field of the table, though there are exceptions. Here is an example of a hook (from Module:Road data/strings/MEX):

MEX.SH = {shield = {ifexists = true,
                    arg = "state",
                    SON = "HIGHWAYSON %route%.jpg",
                    NLE = "Nuevo Leon State Highway %route%.PNG",
                    default = ""},
          link = {hook = "mask",
                  mask = "Road data/masks/MEX",
                  base = "state",
                  masked = "fullstate",
                  default = "%fullstate% State Highway %route%"},
          abbr = "SH %route%"}

In this example, the parser will process the link by calling the mask hook. In short, this hook takes the argument referenced in base, passes it through the mask module specified in mask, and stores it in the field in the arguments noted in masked. The hook returns the string given in default, which has access to the fullstate argument added by the hook.

Other functionality

Functionality exists to display multiple shields for one route, which is used to display tolled and free shields for routes where they differ. This is done by supplying a table with two values, which are listed without indices. The parser is called twice by the calling module, and it returns one shield per call. An example may be found in Texas:

TX.Both = {shield = {"Texas %route%.svg", "Toll Texas %route% new.svg"},
           link = "Texas State Highway %route%",
           abbr = "SH %route%",
           width = 40}

Structure

Each country has its own module. In the United States and Canada, each state/territory/province also has its own module. Each module begins with a comment stating the name of the country or state, followed by the root table declaration, as follows (from Module:Road data/strings/USA/AS):

-- American Samoa
local AS = {}

The root table is named based on the established abbreviation for the country or state, which is the same as the abbreviation used in the module title. This table stores the various types used in that particular place. Most of the remaining code in the module defines these various types. The module ends by returning the root table:

return AS

Aliasing

There are two ways to define a type as an alias. If the type is defined within the module, simply set the new type as equal to the type being aliased, as shown above (from Module:Road data/strings/HKG):

HKG.Route = {shield = "HK Route%route%.svg",
             link = "Route %route% (Hong Kong)",
             abbr = "Route %route%"}
 
HKG.route = HKG.Route

If the type is defined in a separate module, such as a state highway type being used in another state's module, a special syntax may be used to refer to that module (from Module:Road data/strings/USA/NJ):

NJ.NY = {alias = {module = "USA/NY", type = "NY"}}

This code sets the NY type as a link to the NY type in Module:Road data/strings/USA/NY. The parser will import that module and process the type as if the original module had declared it itself. The alias declaration may not add or override any data in the type table it points to.

Style

There are a few style guidelines that should be followed:

  1. Align table fields using spaces. All tables should be aligned so that fields line up with each other, as shown in the above examples.
  2. Do not place a table's closing brace on a separate line.
  3. Each table field should be on its own line.
  4. Add spaces to either side of an assignment operator (equals sign).
  5. Leave a blank line between types. Type aliases should be set off from their base type by a blank line, but no blank lines should be placed between the aliases themselves.

-- China
local CHN = {}

CHN.AH = {shield = "Tabliczka AH%route%.svg",
          link = "AH%route%",
          abbr = "AH%route%"}

CHN.G = {shield = "Kokudou %route%(China).svg",
         link = "China National Highway %route%",
         abbr = "G%route%"}

CHN.Guodao = CHN.G

CHN.X = {shield = "China County Road X%route%.svg",
         link = "",
         abbr = "X%route%"}

CHN.Expwy = {shield = "China Expwy G%route% sign no name.svg",
             link = {["1"] = "G1 Beijing–Harbin Expressway",
                     ["2"] = "G2 Beijing–Shanghai Expressway",
                     ["3"] = "G3 Beijing–Taipei Expressway",
                     ["4"] = "G4 Beijing–Hong Kong–Macau Expressway",
                     ["5"] = "G5 Beijing–Kunming Expressway",
                     ["6"] = "G6 Beijing–Lhasa Expressway",
                     ["7"] = "G7 Beijing–Ürümqi Expressway",
                     ["0111"] = "G0111 Qinhuangdao–Binzhou Expressway",
                     ["0211"] = "G0211 Tianjin–Shijiazhuang Expressway",
                     ["0511"] = "G0511 Deyang–Dujiangyan Expressway",
                     ["0512"] = "G0512 Chengdu–Leshan Expressway",
                     ["0611"] = "G0611 Zhangye–Wenchuan Expressway",
                     ["0612"] = "G0612 Xining–Hotan Expressway",
                     ["0613"] = "G0613 Xining–Lijiang Expressway",
                     ["0615"] = "G0615 Delhi–Barkam Expressway",
                     ["0711"] = "G0711 Ürümqi–Ruoqiang Expressway",
                     ["0121"] = "G0121 Beijing–Qinhuangdao Expressway",
                     ["0321"] = "G0321 Dezhou–Shangrao Expressway",
                     ["0421"] = "G0421 Xuchang–Guangzhou Expressway",
                     ["0422"] = "G0422 Wuhan–Shenzhen Expressway",
                     ["0423"] = "G0423 Lechang–Guangzhou Expressway",
                     ["0425"] = "G0425 Guangzhou–Macau Expressway",
                     ["11"] = "G11 Hegang–Dalian Expressway",
                     ["15"] = "G15 Shenyang–Haikou Expressway",
                     ["25"] = "G25 Changchun–Shenzhen Expressway",
                     ["35"] = "G35 Jinan–Guangzhou Expressway",
                     ["45"] = "G45 Daqing–Guangzhou Expressway",
                     ["55"] = "G55 Erenhot–Guangzhou Expressway",
                     ["59"] = "G59 Hohhot–Beihai Expressway",
                     ["65"] = "G65 Baotou–Maoming Expressway",
                     ["69"] = "G69 Yinchuan–Baise Expressway",
                     ["75"] = "G75 Lanzhou–Haikou Expressway",
                     ["85"] = "G85 Yinchuan–Kunming Expressway",
                     ["1111"] = "G1111 Hegang–Harbin Expressway",
                     ["1112"] = "G1112 Ji'an–Shuangliao Expressway",
                     ["1113"] = "G1113 Dandong–Fuxin Expressway",
                     ["1511"] = "G1511 Rizhao–Lankao Expressway",
                     ["1512"] = "G1512 Ningbo–Jinhua Expressway",
                     ["1513"] = "G1513 Wenzhou–Lishui Expressway",
                     ["1514"] = "G1514 Ningde–Shangrao Expressway",
                     ["1515"] = "G1515 Yancheng–Jingjiang Expressway",
                     ["1516"] = "G1516 Yancheng–Luoyang Expressway",
                     ["1517"] = "G1517 Putian–Yanling Expressway",
                     ["2511"] = "G2511 Xinmin–Lubei Expressway",
                     ["2512"] = "G2512 Fuxin–Jinzhou Expressway",
                     ["2513"] = "G2513 Huai'an–Xuzhou Expressway",
                     ["2515"] = "G2515 Lubei–Holingol Expressway",
                     ["2516"] = "G2516 Dongying–Lüliang Expressway",
                     ["2517"] = "G2517 Sha County–Xiamen Expressway",
                     ["2518"] = "G2518 Shenzhen–Cenxi Expressway",
                     ["3511"] = "G3511 Heze–Baoji Expressway",
                     ["4511"] = "G4511 Longnan–Heyuan Expressway",
                     ["4512"] = "G4512 Shuangliao–Nenjiang Expressway",
                     ["4513"] = "G4513 Naiman–Yingkou Expressway",
                     ["4515"] = "G4515 Chifeng–Suizhong Expressway",
                     ["5511"] = "G5511 Jining–Arun Expressway",
                     ["5512"] = "G5512 Jincheng–Xinxiang Expressway",
                     ["5513"] = "G5513 Changsha–Zhangjiajie Expressway",
                     ["5515"] = "G5515 Zhangjiajie–Nanchong Expressway",
                     ["5516"] = "G5516 Sonid–Zhangjiakou Expressway",
                     ["6511"] = "G6511 Wuzhou–Liuzhou Expressway",
                     ["6911"] = "G6911 Ankang–Laifeng Expressway",
                     ["7511"] = "G7511 Qinzhou–Dongxing Expressway",
                     ["8511"] = "G8511 Kunming–Mohan Expressway",
                     ["8512"] = "G8512 Jinghong–Daluo Expressway",
                     ["8513"] = "G8513 Pingliang–Mianyang Expressway",
                     ["8515"] = "G8515 Guang'an–Luzhou Expressway",
                     ["1521"] = "G1521 Changshu–Jiashan Expressway",
                     ["1522"] = "G1522 Changshu–Taizhou Expressway",
                     ["1523"] = "G1523 Ningbo–Dongguan Expressway",
                     ["6521"] = "G6521 Yulin–Lantian Expressway",
                     ["10"] = "G10 Suifenhe–Manzhouli Expressway",
                     ["12"] = "G12 Hunchun–Ulanhot Expressway",
                     ["16"] = "G16 Dandong–Xilinhot Expressway",
                     ["18"] = "G18 Rongcheng–Wuhai Expressway",
                     ["20"] = "G20 Qingdao–Yinchuan Expressway",
                     ["22"] = "G22 Qingdao–Lanzhou Expressway",
                     ["30"] = "G30 Lianyungang–Khorgas Expressway",
                     ["36"] = "G36 Nanjing–Luoyang Expressway",
                     ["40"] = "G40 Shanghai–Xi'an Expressway",
                     ["42"] = "G42 Shanghai–Chengdu Expressway",
                     ["50"] = "G50 Shanghai–Chongqing Expressway",
                     ["56"] = "G56 Hangzhou–Ruili Expressway",
                     ["60"] = "G60 Shanghai–Kunming Expressway",
                     ["70"] = "G70 Fuzhou–Yinchuan Expressway",
                     ["72"] = "G72 Quanzhou–Nanning Expressway",
                     ["76"] = "G76 Xiamen–Chengdu Expressway",
                     ["78"] = "G78 Shantou–Kunming Expressway",
                     ["80"] = "G80 Guangzhou–Kunming Expressway",
                     ["1011"] = "G1011 Harbin–Tongjiang Expressway",
                     ["1012"] = "G1012 Jiansanjiang–Heixiazi Island Expressway",
                     ["1013"] = "G1013 Hailar–Zhangjiakou Expressway",
                     ["1015"] = "G1015 Tieli–Horqin Expressway",
                     ["1211"] = "G1211 Jilin–Heihe Expressway",
                     ["1212"] = "G1212 Shenyang–Jilin Expressway",
                     ["1213"] = "G1213 Bei'an–Mohe Expressway",
                     ["1215"] = "G1215 Songjiang–Changbaishan Expressway",
                     ["1216"] = "G1216 Ulanhot–Alide'er Expressway",
                     ["1611"] = "G1611 Hexigten–Chengde Expressway",
                     ["1811"] = "G1811 Huanghua–Shijiazhuang Expressway",
                     ["1812"] = "G1812 Cangzhou–Yulin Expressway",
                     ["1813"] = "G1813 Weihai–Qingdao Expressway",
                     ["1815"] = "G1815 Weifang–Rizhao Expressway",
                     ["1816"] = "G1816 Wuhai–Maqên Expressway",
                     ["1817"] = "G1817 Wuhai–Yinchuan Expressway",
                     ["2011"] = "G2011 Qingdao–Xinhe Expressway",
                     ["2012"] = "G2012 Dingbian–Wuwei Expressway",
                     ["2211"] = "G2211 Changzhi–Yan'an Expressway",
                     ["3011"] = "G3011 Liuyuan–Golmud Expressway",
                     ["3012"] = "G3012 Turpan–Hotan Expressway",
                     ["3013"] = "G3013 Kashgar–Irkeshtam Expressway",
                     ["3014"] = "G3014 Kuytun–Altay Expressway",
                     ["3015"] = "G3015 Kuytun–Tacheng Expressway",
                     ["3016"] = "G3016 Qingshuihe–Yining Expressway",
                     ["3017"] = "G3017 Wuwei–Jinchang Expressway",
                     ["3018"] = "G3018 Jinghe–Alashankou Expressway",
                     ["3019"] = "G3019 Bole–Alashankou Expressway",
                     ["4011"] = "G4011 Yangzhou–Liyang Expressway",
                     ["4012"] = "G4012 Liyang–Ningde Expressway",
                     ["4211"] = "G4211 Nanjing–Wuhu Expressway",
                     ["4212"] = "G4212 Hefei–Anqing Expressway",
                     ["4213"] = "G4213 Macheng–Ankang Expressway",
                     ["4215"] = "G4215 Chengdu–Zunyi Expressway",
                     ["4216"] = "G4216 Chengdu–Lijiang Expressway",
                     ["4217"] = "G4217 Chengdu–Qamdo Expressway",
                     ["4218"] = "G4218 Ya'an–Kargilik Expressway",
                     ["4219"] = "G4219 Qüxü–Nêdong Expressway",
                     ["5011"] = "G5011 Wuhu–Hefei Expressway",
                     ["5012"] = "G5012 Enshi–Guangyuan Expressway",
                     ["5013"] = "G5013 Chongqing–Chengdu Expressway",
                     ["5611"] = "G5611 Dali–Lijiang Expressway",
                     ["5612"] = "G5612 Dali–Lincang Expressway",
                     ["5613"] = "G5613 Baoshan–Lushui Expressway",
                     ["5615"] = "G5615 Tianbao–Houqiao Expressway",
                     ["6011"] = "G6011 Nanchang–Shaoguan Expressway",
                     ["7011"] = "G7011 Shiyan–Tianshui Expressway",
                     ["7211"] = "G7211 Nanning–Youyiguan Expressway",
                     ["7212"] = "G7212 Liuzhou–Beihai Expressway",
                     ["7611"] = "G7611 Duyun–Shangri-La Expressway",
                     ["7612"] = "G7612 Nayong–Xingyi Expressway",
                     ["8011"] = "G8011 Kaiyuan–Hekou Expressway",
                     ["8012"] = "G8012 Mi'le–Chuxiong Expressway",
                     ["8013"] = "G8013 Yanshan–Wenshan Expressway",
                     ["1221"] = "G1221 Yanji–Changchun Expressway",
                     ["3021"] = "G3021 Lintong–Xingping Expressway",
                     ["4221"] = "G4221 Shanghai–Wuhan Expressway",
                     ["5021"] = "G5021 Shizhu–Chongqing Expressway",
                     ["6021"] = "G6021 Hangzhou–Changsha Expressway",
                     ["91"] = "G91 Liaozhong Ring Expressway",
                     ["92"] = "G92 Hangzhou Bay Ring Expressway",
                     ["93"] = "G93 Chengyu Ring Expressway",
                     ["94"] = "G94 Pearl River Delta Ring  Expressway",
                     ["95"] = "G95 Capital Region Ring Expressway",
                     ["98"] = "G98 Hainan Island Ring Expressway",
                     ["99"] = "G99 Taiwan Ring Expressway",
                     ["9111"] = "G9111 Benxi–Ji'an Expressway",
                     ["9211"] = "G9211 Ningbo–Zhoushan Expressway",
                     ["9411"] = "G9411 Dongguan–Foshan Expressway",
                     ["9511"] = "G9511 Laishui–Laiyuan Expressway",
                     ["9811"] = "G9811 Haikou–Sanya Expressway",
                     ["9812"] = "G9812 Haikou–Qionghai Expressway",
                     ["9813"] = "G9813 Wanning–Yangpu Expressway",
                     ["9221"] = "G9221 Hangzhou–Ningbo Expressway",
                     ["0401"] = "G0401 Changsha Ring Expressway",
                     ["0601"] = "G0601 Xining Ring Expressway",
                     ["0602"] = "G0602 Lhasa Ring Expressway",
                     ["1001"] = "G1001 Harbin Ring Expressway",
                     ["1101"] = "G1101 Dalian Ring Expressway",
                     ["1501"] = "G1501 Shenyang Ring Expressway",
                     ["1502"] = "G1502 Qingdao Ring Expressway",
                     ["1503"] = "G1503 Shanghai Ring Expressway",
                     ["1504"] = "G1504 Ningbo Ring Expressway",
                     ["1505"] = "G1505 Fuzhou Ring Expressway",
                     ["1506"] = "G1506 Xiamen Ring Expressway",
                     ["1507"] = "G1507 Shenzhen Ring Expressway",
                     ["1508"] = "G1508 Guangzhou Ring Expressway",
                     ["2001"] = "G2001 Jinan Ring Expressway",
                     ["2002"] = "G2002 Shijiazhuang Ring Expressway",
                     ["2003"] = "G2003 Taiyuan Ring Expressway",
                     ["2004"] = "G2004 Yinchuan Ring Expressway",
                     ["2201"] = "G2201 Lanzhou Ring Expressway",
                     ["2501"] = "G2501 Changchun Ring Expressway",
                     ["2502"] = "G2502 Tianjin Ring Expressway",
                     ["2503"] = "G2503 Nanjing Ring Expressway",
                     ["2504"] = "G2504 Hangzhou Ring Expressway",
                     ["3001"] = "G3001 Zhengzhou Ring Expressway",
                     ["3002"] = "G3002 Xi'an Ring Expressway",
                     ["3003"] = "G3003 Ürümqi Ring Expressway",
                     ["4001"] = "G4001 Hefei Ring Expressway",
                     ["4201"] = "G4201 Wuhan Ring Expressway",
                     ["4202"] = "G4202 Chengdu Ring Expressway",
                     ["4501"] = "G4501 Beijing Ring Expressway",
                     ["5001"] = "G5001 Chongqing Ring Expressway",
                     ["5601"] = "G5601 Kunming Ring Expressway",
                     ["5901"] = "G5901 Hohhot Ring Expressway",
                     ["6001"] = "G6001 Nanchang Ring Expressway",
                     ["6002"] = "G6002 Guiyang Ring Expressway",
                     ["7201"] = "G7201 Nanning Ring Expressway",
             	     ["9801"] = "G9801 Haikou Ring Expressway"},
             abbr = "G%route%"}

CHN.Ex = CHN.Expwy

CHN.S = {shield = {hook = "mask",
                   mask = "Road data/masks/CHN",
                   base = "state",
                   masked = "province",
                   default = {ifexists = true,
                              default = "[province||%province% Expwy S%route% sign no name.svg|Shoudou %route%(China).svg]",
                              otherwise = {ifexists = true,
                                           default = "Shoudou %route%(China).svg"}}},
         link = {arg = "state",
                 ["BJ"] = {["11"] = "Beijing–Chengde Expressway",
                           ["12"] = "Airport Expressway (Beijing)",
                           ["28"] = "Northern Airport Expressway",
                           ["51"] = "2nd Airport Expressway",
                           ["50"] = "5th Ring Road"},
                 ["SH"] = {["1"] = "S1 Yingbin Expressway",
                           ["2"] = "S2 Shanghai–Luchaogang Expressway",
                           ["3"] = "S3 Shanghai–Fengxian Highway",
                           ["4"] = "S4 Shanghai–Jinshan Expressway",
                           ["5"] = "S5 Shanghai–Jiading Expressway",
                           ["6"] = "S6 Shanghai–Nanxiang Expressway",
                           ["12"] = "S12 Chongming–Haimen Expressway",
                           ["16"] = "Shanghai–Yixing Expressway",
                           ["19"] = "S19 Xinnong–Jinshanwei Expressway",
                           ["20"] = "S20 Outer Ring Expressway",
                           ["22"] = "S22 Jiading–Anting Expressway",
                           ["26"] = "Shanghai–Changzhou Expressway",
                           ["32"] = "Shanghai–Jiaxing–Huzhou Expressway",
                           ["36"] = "S36 Tinglin–Fengjing Expressway"},
                 ["JS"] = {["5"] = "S5 Changshu–Jiashan Expressway",
                           ["9"] = "S9 Suzhou–Shaoxing Expressway",
                           ["19"] = "S19 Nantong–Wuxi Expressway",
                           ["29"] = "S29 Yancheng–Jingjiang Expressway",
                           ["35"] = "S35 Taizhou–Zhenjiang Expressway",
                           ["39"] = "S39 Jiangdu–Yixing Expressway",
                           ["45"] = "S45 Yixing–Hangzhou Expressway",
                           ["49"] = "S49 Xinyi–Yangzhou Expressway",
                           ["51"] = "S51 Liyang–Huangshan Expressway",
                           ["55"] = "S55 Nanjing–Xuancheng Expressway",
                           ["59"] = "S59 Nanjing–Hexian Expressway",
                           ["65"] = "S65 Xuzhou–Mingguang Expressway",
                           ["69"] = "S69 Jinan–Xuzhou Expressway",
                           ["8"] = "S8 Siyang–Suzhou Expressway",
                           ["18"] = "S18 Yancheng–Huai'an Expressway",
                           ["22"] = "S22 Yizheng–Nanjing Expressway",
                           ["28"] = "S28 Qidong–Yangzhou Expressway",
                           ["32"] = "S32 Chongming–Haimen Expressway",
                           ["38"] = "S38 Changshu–Hefei Expressway",
                           ["48"] = "Shanghai–Yixing Expressway",
                           ["58"] = "Shanghai–Changzhou Expressway",
                           ["68"] = "S68 Liyang–Wuhu Expressway",
                           ["72"] = "S72 Port of Lianyungang North Port Expressway",
                           ["73"] = "S73 Port of Lianyungang East Port Expressway",
                           ["75"] = "S75 Funing–Xinghua–Taizhou Branch Expressway",
                           ["79"] = "S79 Nantong Branch Expressway",
                           ["80"] = "S80 Port of Taicang North Port Expressway",
                           ["81"] = "S81 Port of Taicang South Port Expressway",
                           ["82"] = "S82 Port of Zhangjiagang Port Expressway",
                           ["83"] = "S83 Wuxi Branch Expressway",
                           ["85"] = "S85 Liyang Branch Expressway",
                           ["86"] = "S86 Zhenjiang Branch Expressway",
                           ["87"] = "S87 Nanjing Branch Expressway",
                           ["88"] = "S88 Nanjing Lukou International Airport Expressway",
                           ["92"] = "S92 Jinhu Branch Expressway",
                           ["96"] = "S96 Suqian Branch Expressway"},
         	     ["GD"] = {["1"] = "S1 Guangzhou–Lechang Expressway",
         	     	       ["2"] = "S2 Guangzhou–Heyuan Expressway",
         	     	       ["3"] = "S3 Guangzhou–Shenzhen Riverbank Expressway",
         	     	       ["4"] = "Huanan Expressway",
         	     	       ["4W"] = "S4W Guangzhou–Macau Expressway Zhuhai Branch Line",
         	     	       ["5"] = "S5 Guangzhou–Gaoming Expressway",
         	     	       ["6"] = "S6 Guangzhou–Zhongshan–Jiangmen Expressway",
         	     	       ["8"] = "S8 Guangzhou–Foshan–Zhaoqing Expressway",
         	     	       ["10"] = "S10 Shaoguan–Ganzhou Expressway",
         	     	       ["12"] = "S12 Meizhou–Longyan Expressway",
         	     	       ["13"] = "S13 Jieyang–Huilai Expressway",
         	     	       ["14"] = "S14 Shantou–Zhanjiang Expressway",
         	     	       ["15"] = "S15 Shenyang–Haikou Expressway Guangzhou Branch Line",
         	     	       ["16"] = "S16 Paitan–Jiekou Expressway",
         	     	       ["17"] = "S17 Chaozhou–Huilai Expressway",
         	     	       ["20"] = "S20 Chaozhou–Dongguan Expressway",
         	     	       ["21"] = "S21 Guangzhou–Huidong Expressway",
         	     	       ["22"] = "S22 Longbeiling–Lincun Expressway",
         	     	       ["23"] = "S23 Huizhou–Aotou Expressway",
         	     	       ["25"] = "S25 Changchun–Shenzhen Expressway Huizhou Branch Line",
         	     	       ["26"] = "S26 Shenzhen–Luoding Expressway",
         	     	       ["27"] = "S27 Renhua–Shenzhen Expressway",
         	     	       ["28"] = "S28 Shuijing–Guanjingtou Expressway",
         	     	       ["29"] = "S29 Conghua–Dongguan–Shenzhen Expressway",
         	     	       ["30"] = "S30 Huizhou–Shenzhen Coastal Expressway",
         	     	       ["31"] = "S31 Longhua–Dalingshan Expressway",
         	     	       ["32"] = "S32 Western Coastal Expressway",
         	     	       ["3211"] = "S3211 Zhuhai Airport Expressway",
         	     	       ["3213"] = "S3213 Gaolan Port Expressway",
         	     	       ["33"] = "S33 Nanshan–Guangming Expressway",
         	     	       ["39"] = "S39 Dongsha–Xingang Expressway",
         	     	       ["41"] = "S41 Guangzhou Airport Expressway",
         	     	       ["43"] = "S43 Guangzhou–Zhuhai West Expressway",
         	     	       ["45"] = "S45 Fosha–Jiangmen Expressway",
         	     	       ["47"] = "S47 Jiangman–Zhuhai Expressway",
         	     	       ["49"] = "S49 Xinhui–Taishan Expressway",
         	     	       ["51"] = "S51 Luoding–Yangjiang Expressway",
         	     	       ["55"] = "S55 Erenhot–Guangzhou Expressway Guangzhou Branch Line",
         	     	       ["75"] = "S75 Lanzhou–Haikou Expressway Zhanjiang Branch Line",
         	     	       ["81"] = "S81 Guangzhou Ring Expressway",
         	     	       ["82"] = "S82 Foshan First Ring Expressway",
         	     	       ["83"] = "S83 Meizhou Ring Expressway",
         	     	       ["84"] = "S84 Shaoguan Ring Expressway",
         	     	       ["86"] = "S86 Shenzhen Ring Expressway",
         	     	       ["105"] = "S105 Nansha Port Expressway",
         	     	       ["110"] = "S110 Guangzhou–Qingyuan Expressway",
         	     	       ["202"] = "S202 Huizhou–Yantian Expressway",
         	     	       ["209"] = "S209 Qingshuihe–Pinghu Expressway",
         	     	       ["301"] = "S301 Nanshan–Pingshan Expressway",
         	     	       ["302"] = "S302 Nansha Port Expressway Yuhuang Branch Line",
         	     	       ["303"] = "Huanan Expressway",
         	     	       ["304"] = "S304 Humen-Xiegang Expressway Humen Port Branch Line"},
         	     ["HA"] = {["1"] = "S1 Zhengzhou Airport Expressway",   
         	     	       ["22"] = "S22 Nanle–Linzhou Expressway",
         	     	       ["26"] = "S26 Taiqian–Huixian Expressway",
         	     	       ["28"] = "S28 Changyuan–Jiyuan Expressway",
         	     	       ["32"] = "S32 Yongcheng–Dengfeng Expressway",
         	     	       ["38"] = "S38 Xincai–Biyang Expressway",
         	     	       ["39"] = "S39 Puyang–Shangcheng Expressway",
         	     	       ["49"] = "S49 Linzhou–Ruzhou Expressway",
         	     	       ["57"] = "S57 Mianchi–Luanchuan Expressway",
         	     	       ["60"] = "S60 Shangqiu–Dengfeng Expressway",
         	     	       ["62"] = "S62 Huaibin–Xinyang Expressway",
         	     	       ["64"] = "S64 Ruyang–Yima Expressway",
         	     	       ["81"] = "S81 Shangqiu–Nanyang Expressway",
         	     	       ["82"] = "S82 Zhengzhou–Minquan Expressway",
         	     	       ["83"] = "S83 Lankao–Nanyang Expressway",
         	     	       ["85"] = "S85 Zhengzhou–Shaolinsi Expressway",
         	     	       ["86"] = "S86 Lankao–Yuanyang Expressway",
         	     	       ["87"] = "S87 Zhengzhou–Yuntaishan Expressway",
         	     	       ["88"] = "S88 Zhengzhou–Xixia Expressway",
         	     	       ["89"] = "S89 Zhengzhou Airport–Xihua Expressway",
         	     	       ["90"] = "S90 Kaifeng–Weishi Expressway",
         	     	       ["91"] = "S91 Anyang Northwest Ring Expressway",
         	     	       ["92"] = "S92 Xinxiang–Huixian Expressway",
         	     	       ["93"] = "S93 Jiyuan–Luoyang Expressway",
         	     	       ["94"] = "S94 Luanchuan–Lushi Expressway",
         	     	       ["95"] = "S95 Sanmenxia Bridge Expressway",
         	     	       ["96"] = "S96 Luoyang–Luanchuan Expressway",
         	     	       ["97"] = "S97 Luoyang–Lushi Expressway",
         	     	       ["98"] = "S98 Neixiang–Dengzhou Expressway",
         	     	       ["99"] = "S99 Qushou–Laohekou Expressway" }},
         abbr = {hook = "mask",
                 mask = "Road data/masks/CHN",
                 base = "state",
                 masked = "province",
                 default = "[province||%province%|] S%route%"}}

return CHN