Proposal

edit

This document is part of a proposal to modify the following templates by adding the code shown:

Under review

Tested

<includeonly>{{ #ifeq: {{{1|x}}}|x| [[Category:{{{category|Places}}} on Earth]] | [[Category:{{{category|Places}}} near {{ #expr: {{{1}}} round 0}}°{{ #ifeq: {{ #expr: {{{1}}} round 0 }} | 0 | |{{{2}}} }} {{ #expr: {{{3}}} round 0 }}°{{ #ifeq: {{ #expr: {{{3}}} round 0 }} | 180 | | {{ #ifeq: {{ #expr: {{{3}}} round 0 }} | 0 | | {{{4}}} }} }}]] }}</includeonly>

In testing

<includeonly>{{ #ifeq: {{{1|x}}}|x| [[Category:{{{category|Places}}} on Earth]] | [[Category:{{{category|Places}}} near {{ #expr: {{{1}}} round 0}}°{{ #ifeq: {{ #expr: {{{1}}} round 0 }} | 0 | |{{{3}}} }} {{ #expr: {{{4}}} round 0 }}°{{ #ifeq: {{ #expr: {{{4}}} round 0 }} | 180 | | {{ #ifeq: {{ #expr: {{{4}}} round 0 }} | 0 | | {{{6}}} }} }}]] }}</includeonly>

In testing

<includeonly>{{ #ifeq: {{{1|x}}}|x| [[Category:{{{category|Places}}} on Earth]] | [[Category:{{{category|Places}}} near {{ #expr: {{{1}}} round 0}}°{{ #ifeq: {{ #expr: {{{1}}} round 0 }} | 0 | |{{{4}}} }} {{ #expr: {{{5}}} round 0 }}°{{ #ifeq: {{ #expr: {{{5}}} round 0 }} | 180 | | {{ #ifeq: {{ #expr: {{{5}}} round 0 }} | 0 | | {{{8}}} }} }}]] }}</includeonly>

Usage

edit

Articles using this template will be added to the category based on their position. For instance, an item using {{coor d|32.616|N|121.322|W}} will be added to the category Places near 33°N 121°W. Items near the equator, meridian, or date line will not have their directional component attached. For instance, {{coor d|0.410|N|179.669|W}} will be added to the category Places near 0° 180°.

If no coordinates are present, the category Places on Earth is used instead, though how to handle this more effectively can and should be by consensus.

The word Places is optional. By setting the category parameter, an editor can override the category. For instance: {{coor d|45.34|N|122.2|W|category=Commercial Buildings}} would add the category Commercial Buildings near 45°N 122°W. Please read the warnings at WP:OCAT.