Template:ParseWDCoords/doc
Appearance
This is a documentation subpage for Template:ParseWDCoords. It may contain usage information, categories and other content that is not part of the original template page. |
This template uses the Wikidata property:
This template parses the output from a wikidata fetch operation (e.g. {{#property:P625}}
String format = 99°[99'[99"]] A 999°[99'[99"]]) and parses it into its 8 constituents
- latitude degrees
- latitude minutes
- latitude seconds
- latitide hemisphere (N or S)
- longitude degrees
- longitude minutes
- longitude seconsd
- longitude hemisphere (E or W)
- Notes
- Even though it was designed for output from wikidata, any character string with the correct format may be parsed. It is assumed that minutes (seconds) occur in pairs - so either both coordinate minutes (seconds) are present or neither is. Although seconds ought not appear without minutes, this rule is immaterial for this routine.
- Output from wikidata contains the actual character string ' rather than literal apostrophe ' or any other symbol for arcminutes
- Output from wikidata contains the actual character string " rather than literal quotes " or any other symbol for arcseconds
- Template is invoked with two unnamed parameters:
|1=number of element to return from list above (1–8)
|2=optional character string – default is {{#property:P625}}
Example: Working on 89°39'48"N, 123°52'1"E gives:
- S1 latd= 89
- S2 latm= 39
- S3 lats= 48
- S4 latNS= N
- S5 longd= 123
- S6 longm= 52
- S7 longs= 1
- S8 longEW= E