For faster navigation, this Iframe is preloading the Wikiwand page for 模板:Coord.

模板:Coord

文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

((coord))模板根基于地理坐标及其他参数,生成一个前往地图资源清单的链接,并提供一个标准化的坐标表示法。

此模板要用地球上的WGS84地理坐标(经度纬度),坐标可以使用适当的精确度以十进位计数法(小数)输入,或者用//参数输入。本模板链接到https://tools.wmflabs.org/geohack//geohack.php?language=zh&pagename=Template:Coord&params=xxx ,并显示坐标值。点击其中的蓝色星球会激活WikiMiniAtlas地图显示(需要Javascript)。

注意:中国大陆地区的商业地形图坐标都加了偏移,建议优先使用OpenStreetMap坐标。(右键“显示地址”即可读出。)如要使用Google或Bing的数据,请使用卫星地图中的坐标。百度地图和Google.cn的卫星图也都有偏移,应避免使用。地形图中的坐标由于使用的是来自于中国大陆厂商提供的坐标数据,已经根据中国政府的要求人工偏移。要将这类坐标修正为WGS84,可以使用User:Artoria2e5/Gadget-PRCoords.js小工具或其线上版本(请使用带cai的高精度解);其中大部分地图使用的是GCJ-02偏移算法,百度地图用的则是BD-09

坐标用法速查
要在条目顶端加入57°18′22″N 4°27′32″W / 57.30611°N 4.45889°W / 57.30611; -4.45889,可以这样使用 ((Coord)):
((Coord|57|18|22|N|4|27|32|W|display=title))

此处的经纬坐标使用角度、分、秒表示法。

"display=title" 表示将坐标显示在条目标题旁。

要在条目顶端加入 44°06′43″N 87°54′47″W / 44.112°N 87.913°W / 44.112; -87.913,可以使用以下两者之一:
((Coord|44.112|N|87.913|W|display=title))

((Coord|44.112|-87.913|display=title))

此处坐标使用小数度数表示。

以下可选参数跟在经度后,以下划线("_")分割:

以下可选参数使用竖线("|")分割:

  • display
    |display=inline(默认)只和文字显示在一起
    |display=title 只在标题旁显示
    |display=inline,title 两处都显示
  • name
    name=X 可以制定地图上坐标点的名称(默认为PAGENAME

例如:((Coord|44.117|-87.913|dim:30_region:US-WI_type:event

|display=inline,title|name=事故地点))

|display=title|display=inline,title 用于条目所表述的对象,只应在条目中出现一次。

若使用其他的角度单位,请参看以下转换表:

相同角度的转换表
角度单位
角度 30° 45° 60° 90° 180° 270° 360°
弧度
梯度

本模板的输出数据以下列形式提供:

  • 度/分/秒(“DMS”,精确度是度、或度/分、或度/分/秒,基于输入值)。一些从十进制(小数的)度到度分秒的换算需要修正(参见英文讨论)。
  • 小数(精确度由小数位数确定,基于输入值)。
  • 地理信息

Google地球等不少程序都会解析维基百科的数据库转储文件,寻找((coord))中的坐标信息。为了确认坐标被正确地解析,一定要使用display=title参见如何让我的维基百科条目出现在谷歌地球地理网络层?。一定不要未经预先讨论就匆忙修改本模板。

另请参见地理坐标专题(英文)

取代对象

这个单一的模板将取代以下模板:

所有参数能够像以前一样使用,参见用法

举例:

模板编码 被取代模板编码
((coord|12|N|45|W|display=title)) ((coor title d|12|N|45|W))
((coord|12|34|N|45|33|W|display=title)) ((coor title dm|12|34|N|45|33|W))
((coord|12|34|56|N|45|33|22|W|display=title)) ((coor title dms|12|34|56|N|45|33|8|W))
((coord|12|34|12|N|45|33|45|W|display=inline,title)) ((coor at dms|12|34|12|N|45|33|45|W))
((coord|10.2|-20.3|display=inline)) 或
((coord|10.2|-20.3))
((coor d|10.2|N|-20.3|E))
((coord|44.4|-111.1|type:city_region:US|display=inline,title)) ((Geolinks-US-cityscale|44.4|-111.1))
((coord|51.01234|-1.56789|type:landmark_region:GB|display=inline,title)) ((Geolinks-UK-buildingscale|51.01234|-1.56789))
((coord|-35.5|150.1|type:landmark_region:AU|display=inline,title)) ((Mapit-AUS-suburbscale|lat=-35.5|long=150.1))
((coord|12|34|12|N|45|33|45|W|display=title)) ((CoorHeader|12|34|12|N|45|33|45|W))

用法

((coord|latitude|longitude|坐标参数|模板参数))
((coord|dd|N/S|dd|E/W|坐标参数|模板参数))
((coord|dd|mm|N/S|dd|mm|E/W|坐标参数|模板参数))
((coord|dd|mm|ss|N/S|dd|mm|ss|E/W|坐标参数|模板参数))

有两类参数,都是可选的:

  • 坐标参数:以地图服务器识别,以参数:值的格式给出,并且借由下划线字符“_”互相隔开。常见的坐标参数包括typeregion、和scale。参见坐标参数查看全面的列表。
  • 模板参数:为模板自身所使用,以参数=值的格式给出,并且由管道符“|”互相隔开。支持的模板参数有displaynameformat
    • display可以为下列之一:
      • display=inline — 内联(inline)显示坐标(缺省值)
      • display=title — 显示坐标在条目标题旁边(取代((coor title dms))模板家族),快捷方式为display=t
      • display=inline,title — 同时内联显示和在标题处显示坐标(取代((coor at dms))模板家族)
        注意:使用title属性表明坐标适用于该条目,而不只是适用于条目中提及的某一个地点(可能提及了许多地点)——因此该属性只能在后一种情形下才应当省略。display=title,inline也是有效的。快捷方式为display=it
    • format可以用来强制显示dec或dms坐标给所有读者。
    • name可以用来注释内联坐标,用于在地图服务或其他外部用途中的显示。它不应用到条目标题旁,或显示于一个信息框内部的那些坐标,由于在那些情况下条目标题就是隐含的名称。
    • notes可以用来指定紧接在坐标后的文字。主要用于给标题旁的坐标添加脚注。
    • qid可以用来指定显示哪个数据项的坐标。主要用于使用维基数据的信息框。

举例

((coord|43.651234|-79.383333)) 43°39′04″N 79°23′00″W / 43.651234°N 79.383333°W / 43.651234; -79.383333 多伦多 - 全小数 - N & W
((coord|43.65|-79.38)) 43°39′N 79°23′W / 43.65°N 79.38°W / 43.65; -79.38 多伦多 - 更小精确度
((coord|43.6500|-79.3800)) 43°39′00″N 79°22′48″W / 43.6500°N 79.3800°W / 43.6500; -79.3800 多伦多 - 中等精确度,带尾随零
((coord|43.651234|N|79.383333|W)) 43°39′04″N 79°23′00″W / 43.651234°N 79.383333°W / 43.651234; -79.383333 多伦多 - 小数,带北向纬度差与西向经度差(N & W)
((coord|43|29|N|79|23|W)) 43°29′N 79°23′W / 43.483°N 79.383°W / 43.483; -79.383 多伦多 - 度数与分数
((coord|43|29|4|N|79|23|0|W)) 43°29′4″N 79°23′0″W / 43.48444°N 79.38333°W / 43.48444; -79.38333 多伦多 - 度数、分数与秒数
((coord|43|29|4.5|N|79|23|0.5|W)) 43°29′4.5″N 79°23′0.5″W / 43.484583°N 79.383472°W / 43.484583; -79.383472 多伦多 - 度数、分数与秒数(小数)
((coord|55.752222|N|37.615556|E)) 55°45′08″N 37°36′56″E / 55.752222°N 37.615556°E / 55.752222; 37.615556 莫斯科 - N & E
((coord|55.752222|N|37.615556|E|format=dms)) 55°45′08″N 37°36′56″E / 55.752222°N 37.615556°E / 55.752222; 37.615556 转换至dms格式
((coord|39.098095|-94.587307|format=dms)) 39°05′53″N 94°35′14″W / 39.098095°N 94.587307°W / 39.098095; -94.587307 十进制转换,不带N/S/E/W
((coord|55.752222|N|37.615556|E|​format=dec|name=Moscow)) 55°45′08″N 37°36′56″E / 55.752222°N 37.615556°E / 55.752222; 37.615556 (Moscow) 转换至十进制,并在某些地图上贴上标签
((coord|33|55|S|18|25|E)) 33°55′S 18°25′E / 33.917°S 18.417°E / -33.917; 18.417 开普敦 - S & E
((coord|35|00|N|105|00|E)) 35°00′N 105°00′E / 35.000°N 105.000°E / 35.000; 105.000 中华人民共和国
((coord|22|54|30|S|43|14|37|W)) 22°54′30″S 43°14′37″W / 22.90833°S 43.24361°W / -22.90833; -43.24361 里奥(Rio) - S & W
((coord|22|S|43|W)) 22°S 43°W / 22°S 43°W / -22; -43 一处经纬汇合
((coord|52|28|59|N|1|53|37|W|​display=inline,title|region:GB_type:city)) 52°28′59″N 1°53′37″W / 52.48306°N 1.89361°W / 52.48306; -1.89361 伯明翰(英国) - 带显示及参数设定;注意在本页的标题处也会显示

坐标参数

跟随地理坐标之后,更多参数可能选择性地提供,它们由下划线分隔。这会帮助找到适当的地图资源,当Wikimaps变得完全泛函化(become fully functional)时这一点也会变得更加重要。

type:T

设定这个位置的类型,它将用于小数点的反向映射(the reverse mapping of the points)。类型也将设定缺省地图比例。如果缺省地图比例不适当,可考虑添加一个scale:N参数。类型有:

类型(Type) 描述(Description) 比例尺(Scale)
country (例如 "type:country") 1:10,000,000
satellite 地球同步卫星 (1:10,000,000)
adm1st 国家行政区划,第一级(省、州),参见table,例如美国州份 1:1,000,000
adm2nd 国家行政区划,第二级,参见table,例如县 (美国) 1:300,000
city(pop) 市、镇或村,带指定的人口。pop中的逗号会受到忽略。不能有空白。 1:30,000 ... 1:300,000
city 市、镇或村,未特别指定人口。会被当作一个较小的城市。 1:100,000
airport 机场 1:30,000
mountain 山峰、山脉 1:100,000
isle 岛、岛屿 1:100,000
waterbody 湾、海湾、湖、水库、池塘、港湾、泻湖、河口湾、内海…… 1:100,000
forest 森林、林地 1:50,000
river 江河、运河 1:100,000
glacier 冰川、冰冠 1:50,000
edu 学校、学院、大学 1:10,000
pass 山口 1:10,000
railwaystation 轨道、列车、铁路、地铁、高速交通、遂道、高架铁道,等等 1:10,000
landmark 文化地标、特别有趣的建筑、游览胜地及其他有趣的地点 1:10,000
缺省比例尺:如果没有使用type参数,或者此type在geohack扩展中未定义。 1:300,000

圆括号中的比例尺在geohack扩展中尚未定义。type:state已从列表中撤出。

示例:

scale:N

设定想要的地图比例尺为1:N。这会覆盖由type:T参数确定的比例尺。若未定义type和scale参数,则使用扩展中的缺省的比例尺(1:300,000)。 scale:为可选参数。

示例
比例尺 标记 结果
1:1000 ((coord|51.500611|N|0.124611|W|scale:1000)) 51°30′02″N 0°07′29″W / 51.500611°N 0.124611°W / 51.500611; -0.124611
1:10,000 ((coord|51.500611|N|0.124611|W|scale:10000)) 51°30′02″N 0°07′29″W / 51.500611°N 0.124611°W / 51.500611; -0.124611
1:100,000 ((coord|51.500611|N|0.124611|W|scale:100000)) 51°30′02″N 0°07′29″W / 51.500611°N 0.124611°W / 51.500611; -0.124611
1:1,000,000 ((coord|51.500611|N|0.124611|W|scale:1000000)) 51°30′02″N 0°07′29″W / 51.500611°N 0.124611°W / 51.500611; -0.124611

若前往地图站点的链接在((GeoTemplate))中正确配置,并且某个地图在该比例尺下是可用的,则一个对应的地图可能显示出来。

region:R

设置首选的地图区域覆盖范围,用于为该地区选择适当的地图资源。若未提供region参数,geohack扩展会尝试从坐标值来确定它。

区域应当以下列形式给出:一个双字符的ISO 3166-1国家代码,或者一个ISO 3166-2区域代码。例如:

示例:

特种码:

  • XZ用于国际海域之内/之上的对象(类似于UN/LOCODE
  • ZZ用于示例中
globe:G

指定除了地球(Earth)之外的其他行星,例如月球(Moon)、火星(Mars)、金星(Venus)、水星(Mercury)。

Geohack扩展的大部分特性对于其他星球来说不是很理想的。

source:S

指定(此处出现的)数据源和数据源格式/数据,并且可以选择性地在括号中显示原始数据。这最初主要是为地理标签机器人的应用而准备的,以便数据不被盲目地从格式到格式、从Wikipedia到Wikipedia重复拷贝,那会逐步丧失精度与归属性。

举例:

  • 一个源于英国地形测量局(Ordnance Survey)英国国家格网参考系统(British national grid reference system)NM 435 355,其数据发现于英语维基百科,这样的经/纬地理标签应当标记为“source:enwiki-osgb36(NM435355)”。
  • 一个源于取自德语维基百科的数据的经度-纬度位置,应当标记为“source:dewiki”。对于其他语言代码也类似。
  • 一个源于公众领域地理网络名称服务器数据库的位置应标记为“source:GNS”。数据或格式信息不是必需的,因为缺省情况下所有维基百科坐标都是以基于WGS84数据的经度/纬度格式存在。类似地,源于相似的公众领域GNIS数据库的美国位置应当标记为“source:GNIS”。

显示

缺省情况下坐标以那些指定的格式显示。

若要总是显示坐标为度分秒值,添加以下代码到你的common.css

.geo-default { display: inline } .geo-nondefault { display: inline }
.geo-dec { display: none } .geo-dms { display: inline }

若要总是显示坐标为十进制值,添加以下代码到你的monobook.css:

.geo-default { display: inline } .geo-nondefault { display: inline }
.geo-dec { display: inline } .geo-dms { display: none }

若要同时以两种格式显示坐标,添加以下代码到你的monobook.css:

.geo-default { display: inline } .geo-nondefault { display: inline }
.geo-dec { display: inline } .geo-dms { display: inline }
.geo-multi-punct { display: inline }

如果CSS遭到禁用,或者你有一个被缓存的旧版MediaWiki:Common.css,你将同时看到两种格式。(Common.css的缓存需要31天到期。你可以清空你的缓存,或者手动刷新这个URL:[1]。)

另见en:Wikipedia:Manual of Style (dates and numbers)#Geographical coordinates

错误使用维护

本模板有几个内建的输入检查。基本的错误会显示((Coord/input/error2))中的信息。参见Category:需要修复的经纬模板引用查看需要修复的页面。

类名

类名geolatitudelongitude用来生成微格式,并且一定不要更改。

模板数据

This template uses overloading which does not work well with the VisualEditor/TemplateData.[翻译请求] Consider using "Edit source" instead of the visual editor until this defect is corrected. To facilitate visual editing in the mean time, consider using ((coordDec)) for signed decimal degrees, ((coordDMS)) when degrees minutes and seconds are specified, and ((coordDM)) when just degrees and minutes are given.

以下是该模板的模板数据,适用于可视化编辑器等工具。

Coord模板数据

用于提供一个地点的经纬度坐标,提供该地点的地图链接。This template does not work well with the Visual Editor, consider using ((coordDec)) for signed decimal degrees, ((coordDMS)) when degrees minutes and seconds are specified ((coordDM)) when only degrees and minutes are specified. To use this template you will need to use positional parameter following one of these schemes: ((coord | D | M | S | NS | D | M | S | EW | geo | opts)), ((coord | D | M | NS | D | M | EW | geo | opts)), ((coord | D| NS | D| EW | geo | opts)) ((coord | sD | sD | geo | opts)) where D is degrees, M is minutes, S seconds, sD signed decimal degrees, NS is N or S, EW is E or W, opts are named parameter and geo are the coordinate parameters described on the main doc page.

模板参数[编辑模板数据]

此模板首选参数不换行的行内格式。

参数描述类型状态
11

Either degrees latitude or a signed decimal degrees latitude

数字推荐
22

Either: minutes latitude, signed decimal degrees longitude or 'N' or 'S'.

字符串推荐
33

Either: second latitude, degrees longitude, 'N' or 'S' or GeoHack parameters

字符串可选
44

Either: degrees longitude, 'N', 'S', 'E' or 'W' or GeoHack parameters

字符串可选
55

Either: degrees longitude, minutes longitude or GeoHack parameters

字符串可选
66

Either: minutes longitude, 'E' or 'W' or GeoHack parameters

字符串可选
77

Either second longitude, or GeoHack parameters

字符串可选
88

'E' or 'W'.

字符串可选
99

GeoHack parameters. Example: dim:30_region:US-WI_type:event

字符串可选
维基数据项目qid

从WikiData项目而不是从该模板的参数中检索坐标

示例值
Q513
单行文本可选
显示方式display

显示的位。可填写:'inline',即在条目中;'title',即在条目顶端;'inline,title',两者兼有

默认值
inline
单行文本推荐
名称name

要放置在地图上的标签(默认为页面名)

字符串可选
注释notes

在坐标后面显示的文本

字符串可选
格式format

坐标格式,'dec'或'dms'

单行文本可选

外部链接

{{bottomLinkPreText}} {{bottomLinkText}}
模板:Coord
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?