Template:Data Morocco
This template contains sindry independently retrievable data items anent Morocco in the form of parameter values o a variable template o walin, in a standardised fashion. It is a member o a faimily o templates, those wi names stairtin wi "Data" in Category:Data templates.
Parameters
[eedit soorce]Parameter name | Value | Meanin |
---|---|---|
1
|
Morocco |
last pairt of template name, uised tae identify it within the faimily of templates[1] |
article |
article name; needs tae be specified anly if it differs frae Morocco ; in applications, uise [[{{{article|{{{1}}}}}}]] tae link tae the article (as haes been done at the tap of this page)
| |
short name |
shorter display name tae be uised in some contexts; an application or application parameter can specify whether this is uised; anly intendit for dispensing wi disambiguation in a context whaur it is nae needed | |
type |
country |
teep of entity, e.g. continent, country, province, municipality |
code |
code | |
code description |
code description | |
continent |
Africae |
continent, if type is lawer than "continent" |
country |
country, if type is lawer than "country" | |
province |
province, if type is lawer than "province" | |
popbase
|
33,304,000
|
population on a gien date (stored wioot commas) |
popbaseyear
|
2014
|
year for which the population base figure applies |
popbasemonth
|
7
|
month for which the population base figure applies |
popbaseday
|
1
|
day for which the population base figure applies |
popinc
|
964.3
|
population increase per day; uised tae extrapolate the population figure |
land area
|
446,300
|
land aurie in km2 (stored wioot commas) |
total area
|
446,550
|
tot aurie in km2 (stored wioot commas) |
flag image
|
Flag of Morocco.svg
|
name o the banner image (or ither illustration, if thare is no banner) shawn abuin |
Throughout the faimily of templates, fixed names are uised for the parameters. (The parameter names are kept short tae reduce counts for the post expand include size an the template argument size in cases whaur thir are applicable.) Houiver, nae necessarily aw parameters hae been gien a value: some parameters mey nae be applicable, while for some ither parameters the value mey juist hae nae been specified yet. The table shows aw parameters, an for each the value, if specified.
Related data templates
[eedit soorce]
Derived data
[eedit soorce]The population today is 36,970,000.[2]
The population is
0.454% of that o the warld. It is Expression error: Unrecognised punctuation character "[".% of that of Africae.The total area is 446,550 square kilometre (172,410 sq mi). It is
0.3% of the land area of the world. It is Expression error: Unrecognised punctuation character "[".% of that of Africae.The water area is 0.1% of the total area.
The population density is 82.8 per square kilometre (214.5/sq mi) land area.
Retrieval of data items
[eedit soorce]{{data Morocco|pst2|land area}}
, uisin parameter selection template Template:Pst2, gies the parameter land area, etc.
For retrieval of mair data items it is mair efficient tae prepare a template for that, tae be uised as follows:
{{data Morocco|
template name|..|..|..|..}}
sae that this data template needs tae be cried anly ance.[3] The default template is Template:Show data, producin this page.
The fower parameters are optional, thay are passed on tae the prepared template as parameters 2-5.
Special templates:
- Template:Linkd - link tae article
- Template:Poptoday - uised abuin
- Template:Popdens - for uise on the page Leet o sovereign states and dependent territories by population density
- Template:Poptoday 1 - for uise on the page Leet o countries by population
- Template:Popareadens - for uise on the page Leet o countries by population
A parameter bein undefined or empty teepically means the same, see ablo. {{data ..|pst2|..}}
gies the empty string an the text "{{{..}}}
", respectively. Therefore an application checking the parameter haes tae check baith. Checking whether a result is equal tae e.g. the text "964.3
" canna be done directly wi #ifeq in a template which itself haes an aa a parameter wi that name, acause if that is defined, thare wad be a comparison wi the value instead o the text itself. Instead, it can be checked whether the first character o the result is "{
", e.g.: {{#ifeq:{{padleft:|1|{{data {{{continent}}}|pst2|popinc}}}}|{|..|..}}
.
Creating new data templates
[eedit soorce]Template:Data/preload can be uised tae creaut new data templates. On the page o the data template o a province, if thare is no data template yet for the country, a link appears tae creaut that, preloading this template. Otherwise the wikitext can be copied tae the new data template. For parameters which are nae applicable, sic as country for a country, the parameter definition "country=" can be deleted. For parameters tae be filled in later the parameter definition lik "popinc=" (specifying the empty string as value) can be left in the wikitext tae be filled in later. Do nae forget parameter 1.
Efficiency
[eedit soorce]In this template system ilka template contains sindry properties o a single entity, as opponed tae the ither common system, whaur a template contains ae property (e.g. population or area) o mony entities. Awtho that ither system can be convenient gin updates o a property for aw thir entities become available thegither, in the case of muckle-scale uise of data on ae page that ither system can be problematic acause o its inefficiency. This is acause o the follaein:
- Thare are eften mair entities than properties, an page counts (or in the case of
#switch
, average page counts) are proportional tae the nummer of data items in the data template (if thay are stored in a linear wey, nae in a tree, an nae stored as unnamed parameters). - In the case of lairge-scale uise of data on ane page thare are uisually ane or mair tables, whaur an entity forms a row and a property a column, acause thare are eften mair entities than properties, an acause this wey the sorting featur allows sorting entities based on a property. In this template seestem this allows producin a row wi anly ane caw o the data template, makin the count nae grow faster than proportional tae the average nummer of data items stored per data template, times the nummer of entities in the table.
The include pairt o the data template of an entity daes nae contain a lang leet of its sub-entities or thair properties, acause that wad mak this method inefficient too.
- ↑ It may seem odd, but a template cannot retrieve its own name (PAGENAME only provides this on the template page itself), and even if it could, a string operation would be needed tae remove "Data ". Putting the name of the entity in the data template removes the need tae supply it as a parameter when the data template is called (in the cases that it would need this name).
- ↑ Estimated by extrapolation.
- ↑ See the first two rows of the first table in m:Help:Array#Summary of counts for template limits.
Until here the documentation is automatically generated by Template:Show data.