模板:Lunar quadrangle
表达式错误:无法识别标点符号“{”。
本模板含有复杂而精密的扩展语法。 编辑本模板前,建议您先熟悉解析器函数与本模板的设计思路、运作原理等。若您的编辑引发了意外的问题,请尽快撤销编辑,因为本模板可能被大量页面使用。 您所作的编辑可先在模板沙盒或您的个人页面中进行测试。 |
使用
编辑该模版用于自动生成月球表面上某点所处的月球方格,它有四个参数:
{{Lunar quadrangle |latitude= |N_or_S= |longitude= |E_or_W= }}
例如,点"59.7° S, 21.5° E"应该这样输入:
"{{Lunar quadrangle|latitude=59.7|N_or_S=S|longitude=21.5|E_or_W=E}}"
会显示为:"LQ27"
该模版主要与信息框结合使用,并允许例如Category:月球环形山这样的分类自动生成更低一级的地理子分类。It shouldn't be substed since that brings a bunch of intricate template coding into the article rather than the simple text name.
Structure
编辑This template makes extensive use of comparison parser functions. A #switch statement couldn't be used for most of it because it deals with floating-point numeric ranges rather than discrete integers. To simplify the code, latitude is dealt with in the main template and then one of four sub-templates dealing solely with longitude may be called.
- Template:Lunar quadrangle/30-65N
- Template:Lunar quadrangle/0-30N
- Template:Lunar quadrangle/0-30S
- Template:Lunar quadrangle/30-65S
Each of these sub-templates has two complete lists of quadrangles that lie in the range of latitudes it's dealing with, the second list sorted in reverse from the first list to account for using east longitude instead of west longitude. So one should be able to use the full 0-360° range for both E and W longitude.
No similar provision was made for using negative latitude to indicate southern latitudes.