| 1 |
% !TeX root = mercatormap.tex |
| 2 |
% !TeX encoding=UTF-8 |
| 3 |
% !TeX spellcheck=en_US |
| 4 |
% include file of mercatormap.tex (manual of the LaTeX package mercatormap) |
| 5 |
\clearpage |
| 6 |
\section{Map Definition and Map Coordinates}\label{sec:map_definition}% |
| 7 |
|
| 8 |
\tikzsetnextfilename{def_mrcdefinemap}% |
| 9 |
\begin{dispExample} |
| 10 |
\begin{tikzpicture} |
| 11 |
\mrcdefinemap{west=11,east=13,north=49,south=48} |
| 12 |
\mrcdrawmap[draw=path] |
| 13 |
\mrcdrawnetwork |
| 14 |
\draw (mrc cs:latitude=48.53475,longitude=12.15087) circle (2mm); |
| 15 |
\draw[red] (mrc cs:lat=48.53475,lon=12.15087) circle (3mm); |
| 16 |
\draw[blue] (mrcq cs:48.53475:12.15087) circle (4mm); |
| 17 |
\ifmrcinmap{48.53475}{12.15087}{ \draw[yellow] (mrcpos) circle (5mm);}{} |
| 18 |
\ifmrcinvicinity{48.53475}{12.15087}{\draw[cyan] (mrcpos) circle (6mm);}{} |
| 19 |
\end{tikzpicture} |
| 20 |
\end{dispExample} |
| 21 |
|
| 22 |
%------------------------------------------------------------------------------- |
| 23 |
\subsection{Option Setting} |
| 24 |
\begin{docCommand}{mermapset}{\marg{options}} |
| 25 |
Sets \meta{options} for all following maps inside the current \TeX\ group. |
| 26 |
All options share the common prefix |mermap/|, e.g. for setting |
| 27 |
\refKey{mermap/vicinity} use |
| 28 |
\begin{dispListing} |
| 29 |
\mermapset{vicinity=3cm} |
| 30 |
\end{dispListing} |
| 31 |
Also see \refCom{mrcdefinemap}, \refCom{mermapsetsupply}, |
| 32 |
and \refCom{mermapsetmarker}.\par |
| 33 |
Note that the options by \refCom{mermapset} are |expl3| \cite{package:interface3} |
| 34 |
keys while \tikzname\ \cite{package:tikz} uses its own key management. |
| 35 |
\end{docCommand} |
| 36 |
|
| 37 |
|
| 38 |
\clearpage |
| 39 |
%------------------------------------------------------------------------------- |
| 40 |
\subsection{Manual Map Definition} |
| 41 |
The following map definition is only relevant, if no script setup is used |
| 42 |
and maps are generated completely manually. |
| 43 |
See \Fullref{sec:automated_map} for script aided map definitions. |
| 44 |
|
| 45 |
\begin{docCommand}{mrcdefinemap}{\marg{options}} |
| 46 |
Establishes a map inside a |tikzpicture| environment following |
| 47 |
and applying the given \meta{options}. |
| 48 |
All options share the common prefix |mermap/mapdef/|. |
| 49 |
After \refCom{mrcdefinemap} is applied, map drawing and map coordinates |
| 50 |
can be used. |
| 51 |
\begin{itemize} |
| 52 |
\item\refCom{mrcdefinemap} can be used directly, if no tile download |
| 53 |
and no script setup is intended. |
| 54 |
\item\refCom{mrcdefinemap} is implicitly used with |
| 55 |
\refCom{mrcapplymap} and \refCom{mrcmap}. In this case, all options are |
| 56 |
also set implicitly. |
| 57 |
\end{itemize} |
| 58 |
\end{docCommand} |
| 59 |
|
| 60 |
|
| 61 |
\begin{docMrcKey}[mapdef]{north}{=\meta{map north latitude}}{no default, initially 50} |
| 62 |
Northern latitude degree of the visible map, possibly negative for the southern hemisphere, |
| 63 |
lower than $90$ but always larger than \refKey{mermap/mapdef/south}. |
| 64 |
It is accessible as \docAuxCommand{mrcmapnorth} (use read-only). |
| 65 |
\end{docMrcKey} |
| 66 |
|
| 67 |
\begin{docMrcKey}[mapdef]{south}{=\meta{map south latitude}}{no default, initially 48} |
| 68 |
Southern latitude degree of the visible map, possibly negative for the southern hemisphere, |
| 69 |
larger than $-90$ but always lower than \refKey{mermap/mapdef/north}. |
| 70 |
It is accessible as \docAuxCommand{mrcmapsouth} (use read-only). |
| 71 |
\end{docMrcKey} |
| 72 |
|
| 73 |
\begin{docMrcKey}[mapdef]{west}{=\meta{map west longitude}}{no default, initially 11} |
| 74 |
Western longitude degree of the visible map, possibly negative for the western hemisphere, |
| 75 |
possibly shifted periodically, but always lower than \refKey{mermap/mapdef/east}. |
| 76 |
It is accessible as \docAuxCommand{mrcmapwest} (use read-only). |
| 77 |
\end{docMrcKey} |
| 78 |
|
| 79 |
\begin{docMrcKey}[mapdef]{east}{=\meta{map east longitude}}{no default, initially 13} |
| 80 |
Eastern longitude degree of the visible map, possibly negative for the western hemisphere, |
| 81 |
possibly shifted periodically, but always larger than \refKey{mermap/mapdef/west}. |
| 82 |
It is accessible as \docAuxCommand{mrcmapeast} (use read-only). |
| 83 |
\end{docMrcKey} |
| 84 |
|
| 85 |
|
| 86 |
%------------------------------------------------------------------------------- |
| 87 |
\subsection{Further Map Definition Options} |
| 88 |
|
| 89 |
|
| 90 |
The following options are typically implicitly set by \refCom{mrcapplymap} |
| 91 |
and not manually by \refCom{mrcdefinemap}. However, some values are |
| 92 |
computationally used in all cases. They can be ignored as pure technical |
| 93 |
information. |
| 94 |
|
| 95 |
\begin{docMrcKey}[mapdef]{xmin}{=\meta{map tile x minimum}}{no default, initially 271} |
| 96 |
Minimal $x$ coordinate of the map tiles. |
| 97 |
\end{docMrcKey} |
| 98 |
|
| 99 |
\begin{docMrcKey}[mapdef]{xmax}{=\meta{map tile x maximum}}{no default, initially 275} |
| 100 |
Maximal $x$ coordinate of the map tiles. |
| 101 |
\end{docMrcKey} |
| 102 |
|
| 103 |
\begin{docMrcKey}[mapdef]{ymin}{=\meta{map tile y minimum}}{no default, initially 173} |
| 104 |
Minimal $y$ coordinate of the map tiles. |
| 105 |
\end{docMrcKey} |
| 106 |
|
| 107 |
\begin{docMrcKey}[mapdef]{ymax}{=\meta{map tile y maximum}}{no default, initially 177} |
| 108 |
Maximal $y$ coordinate of the map tiles. |
| 109 |
\end{docMrcKey} |
| 110 |
|
| 111 |
\begin{docMrcKey}[mapdef]{zoom}{=\meta{map zoom}}{no default, initially 9} |
| 112 |
Map tile zoom factor alias $z$ coordinate of the map tiles. |
| 113 |
\end{docMrcKey} |
| 114 |
|
| 115 |
\begin{docMrcKey}[mapdef]{pixelwidth}{=\meta{map width in pixels}}{no default, initially 100} |
| 116 |
Width of the visible map expressed in pixels of the source file(s). |
| 117 |
It is accessible as \docAuxCommand{mrcpixelwidth} (use read-only). |
| 118 |
\end{docMrcKey} |
| 119 |
|
| 120 |
\begin{docMrcKey}[mapdef]{pixelheight}{=\meta{map height in tiles}}{no default, initially 100} |
| 121 |
Height of the visible map expressed in pixels of the source file(s). |
| 122 |
It is accessible as \docAuxCommand{mrcpixelheight} (use read-only). |
| 123 |
\end{docMrcKey} |
| 124 |
|
| 125 |
\begin{docMrcKey}[mapdef]{westoffset}{=\meta{map tile offset (west)}}{no default, initially 0} |
| 126 |
Distance of the visible map from the western edge of the most western tile |
| 127 |
expressed in tiles (range from 0 to 1). |
| 128 |
\end{docMrcKey} |
| 129 |
|
| 130 |
\begin{docMrcKey}[mapdef]{northoffset}{=\meta{map tile offset (north)}}{no default, initially 0} |
| 131 |
Distance of the visible map from the northern edge of the most northern tile |
| 132 |
expressed in tiles (range from 0 to 1). |
| 133 |
\end{docMrcKey} |
| 134 |
|
| 135 |
\begin{docMrcKey}[mapdef]{southoffset}{=\meta{map tile offset (south)}}{no default, initially 0} |
| 136 |
Distance of the visible map from the southern edge of the most southern tile |
| 137 |
expressed in tiles (range from 0 to 1). |
| 138 |
\end{docMrcKey} |
| 139 |
|
| 140 |
\begin{docMrcKey}[mapdef]{basename}{=\meta{map tile base name}}{no default, initially \texttt{tiles/tile}} |
| 141 |
File base name for the tiles. |
| 142 |
\end{docMrcKey} |
| 143 |
|
| 144 |
\begin{docMrcKey}[mapdef]{attribution}{=\meta{attribution text}}{no default, initially empty} |
| 145 |
Attribution text for the map source. Typically, it acknowledges the copyright |
| 146 |
of the map data provider. It may contain hyperlinks. |
| 147 |
It is accessible as \docAuxCommand{mrcmapattribution} (use read-only). |
| 148 |
\end{docMrcKey} |
| 149 |
|
| 150 |
\begin{docMrcKey}[mapdef]{attribution print}{=\meta{attribution text}}{no default, initially empty} |
| 151 |
Attribution text for the map source. |
| 152 |
In contrast to \refKey{mermap/mapdef/attribution} it is intended for media |
| 153 |
that does not support hyperlinks like printed posters, books, etc. |
| 154 |
It is accessible as \docAuxCommand{mrcmapattributionprint} (use read-only). |
| 155 |
\end{docMrcKey} |
| 156 |
|
| 157 |
|
| 158 |
\begin{docMrcKey}[mapdef]{resource}{=\meta{map resource}}{no default, initially |none|} |
| 159 |
Available map resource with following feasible values: |
| 160 |
\begin{itemize} |
| 161 |
\item\docValue{none}: No tiles and no merged map. |
| 162 |
\item\docValue{tiles}: Map tiles locally available. |
| 163 |
\item\docValue{mergedmap}: Single map picture file merged from tiles locally available. |
| 164 |
\item\docValue{wmsmap}: Single map picture file locally available. |
| 165 |
\end{itemize} |
| 166 |
\end{docMrcKey} |
| 167 |
|
| 168 |
\begin{docMrcKey}[mapdef]{tile size}{=\meta{length}}{no default, initially |32.512mm|} |
| 169 |
Typically set computationally. It is identical to \refKey{mermap/tile size} |
| 170 |
which is the recommended user option for manual setup. |
| 171 |
\end{docMrcKey} |
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
\clearpage |
| 176 |
%------------------------------------------------------------------------------- |
| 177 |
\subsection{Map Coordinate System} |
| 178 |
After a map is defined inside a |tikzpicture| environment |
| 179 |
by \refCom{mrcdefinemap}, \refCom{mrcapplymap}, or \refCom{mrcmap}, |
| 180 |
a Mercator map coordinate system can be used. |
| 181 |
The border of the visible map is denoted by a \tikzname\ node \docNode{mrcmap}. |
| 182 |
|
| 183 |
\tikzsetnextfilename{def_coordinate_system}% |
| 184 |
\begin{dispExample} |
| 185 |
\begin{tikzpicture} |
| 186 |
\mrcNPdef{nuremberg}{49.45522}{11.07631} |
| 187 |
\mermapset{tile size=2cm} |
| 188 |
\mrcdefinemap{west=5,east=15,south=47,north=55,zoom=7} |
| 189 |
\path[draw,fill=green!10] (mrcmap.south west) rectangle (mrcmap.north east); |
| 190 |
\mrcdrawnetwork |
| 191 |
\fill (mrc cs:latitude=48.137222,longitude=11.575556) circle (2pt) |
| 192 |
node[below] {M\"unchen}; |
| 193 |
\fill (mrc cs:lat=53.550556,lon=9.993333) circle (2pt) |
| 194 |
node[above] {Hamburg}; |
| 195 |
\fill (mrcq cs:52.518611:13.408333) circle (2pt) |
| 196 |
node[left] {Berlin}; |
| 197 |
\fill (\mrcNPcs{nuremberg}) circle (2pt) node[above] {N\"urnberg}; |
| 198 |
\ifmrcinmap{50.938056}{6.956944}{ |
| 199 |
\fill (mrcpos) circle (2pt) node[right] {K\"oln};}{} |
| 200 |
\ifmrcNPinmap{nuremberg}{\draw[red] (mrcpos) circle (1cm);}{} |
| 201 |
\end{tikzpicture} |
| 202 |
\end{dispExample} |
| 203 |
|
| 204 |
|
| 205 |
\medskip |
| 206 |
The |mrc cs| coordinate system defines a map point by |
| 207 |
\refKey{mermap/cs/latitude} and \refKey{mermap/cs/longitude} |
| 208 |
|
| 209 |
\begin{docMrcKey}[cs]{latitude}{=\meta{latitude}}{no default} |
| 210 |
Sets the \meta{latitude} of a map point. |
| 211 |
\end{docMrcKey} |
| 212 |
|
| 213 |
\begin{docMrcKey}[cs]{longitude}{=\meta{longitude}}{no default} |
| 214 |
Sets the \meta{longitude} of a map point. |
| 215 |
\end{docMrcKey} |
| 216 |
|
| 217 |
\begin{dispListing} |
| 218 |
\fill (mrc cs:latitude=48.137222,longitude=11.575556) circle (2pt); |
| 219 |
\end{dispListing} |
| 220 |
|
| 221 |
\medskip |
| 222 |
A map point can also be defined by shorter variants |
| 223 |
\refKey{mermap/cs/lat} and \refKey{mermap/cs/lon} |
| 224 |
|
| 225 |
\begin{docMrcKey}[cs]{lat}{=\meta{latitude}}{no default} |
| 226 |
Sets the \meta{latitude} of a map point. |
| 227 |
\end{docMrcKey} |
| 228 |
|
| 229 |
\begin{docMrcKey}[cs]{lon}{=\meta{longitude}}{no default} |
| 230 |
Sets the \meta{longitude} of a map point. |
| 231 |
\end{docMrcKey} |
| 232 |
|
| 233 |
\begin{dispListing} |
| 234 |
\fill (mrc cs:lat=48.137222,lon=11.575556) circle (2pt); |
| 235 |
\end{dispListing} |
| 236 |
|
| 237 |
\medskip |
| 238 |
A map point can be defined even quicker by |
| 239 |
|(mrcq cs:|\meta{latitude}|:|\meta{longitude}|)|. |
| 240 |
|
| 241 |
\begin{dispListing} |
| 242 |
\fill (mrcq cs:48.137222:11.575556) circle (2pt); |
| 243 |
\end{dispListing} |
| 244 |
|
| 245 |
\medskip |
| 246 |
|
| 247 |
\begin{docCommand}{mrcpgfpoint}{\marg{latitude}\marg{longitude}} |
| 248 |
Yields a low level |pgf| point location given by |
| 249 |
\meta{latitude} and \meta{longitude}. |
| 250 |
This can be used like |\pgfpoint|. |
| 251 |
\begin{dispListing} |
| 252 |
\pgfpathcircle{\mrcpgfpoint{49.45522}{11.07631}}{2pt} |
| 253 |
\pgfusepath{fill} |
| 254 |
\end{dispListing} |
| 255 |
\end{docCommand} |
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
\clearpage |
| 261 |
%------------------------------------------------------------------------------- |
| 262 |
\subsection{Named Positions}\label{sec:names_positions} |
| 263 |
|
| 264 |
|
| 265 |
\begin{docCommand}{mrcNPdef}{\marg{name}\marg{latitude}\marg{longitude}} |
| 266 |
A coordinate pair of \meta{latitude} and \meta{longitude} |
| 267 |
can be saved as \emph{named position} (NP) to a \meta{name} for later use. |
| 268 |
The \emph{named position} just stores the given values as evaluated |
| 269 |
floating points but without coordinate system processing. |
| 270 |
Therefore, a named position can be used outside a map definition |
| 271 |
or |tikzpicture| environment, even as a preset for the whole document. |
| 272 |
Note that this saving is not global but only effective inside the |
| 273 |
current \TeX\ group. |
| 274 |
\begin{dispListing} |
| 275 |
\mrcNPdef{nuremberg}{49.45522}{11.07631} |
| 276 |
\end{dispListing} |
| 277 |
\end{docCommand} |
| 278 |
|
| 279 |
|
| 280 |
\begin{docCommand}{mrcNPfrompoint}{\marg{name}\marg{\tikzname\ point}} |
| 281 |
\emph{Latitude} and \emph{longitude} of a given \meta{\tikzname\ point} are |
| 282 |
calculated and saved as \emph{named position} (NP) with given \meta{name}. |
| 283 |
\refCom{mrcNPfrompoint} can only be used after a valid a map definition |
| 284 |
inside a |tikzpicture| environment. |
| 285 |
\begin{dispListing} |
| 286 |
\mrcNPfrompoint{mapcenter}{mrcmap.center} |
| 287 |
\mrcNPfrompoint{mytest}{[xshift=1cm,yshift=1cm]mrcmap.south west} |
| 288 |
\end{dispListing} |
| 289 |
\end{docCommand} |
| 290 |
|
| 291 |
|
| 292 |
\begin{docCommand}{mrcNPcs}{\marg{name}} |
| 293 |
A map point definition from the \meta{name} of a previously saved |
| 294 |
\emph{named position} (NP). |
| 295 |
\begin{dispListing} |
| 296 |
\fill (\mrcNPcs{nuremberg}) circle (2pt) node[above] {N\"urnberg}; |
| 297 |
\end{dispListing} |
| 298 |
\end{docCommand} |
| 299 |
|
| 300 |
|
| 301 |
\begin{docCommand}[doc updated=2024-08-02]{mrcNPlat}{\marg{name}} |
| 302 |
Inserts the \emph{latitude} of a \emph{named position} with given \meta{name}. |
| 303 |
\refCom{mrcNPlat} is expandable and may be used in floating point expressions. |
| 304 |
If the \meta{name} does not exist, the macro expands to |0|. |
| 305 |
\begin{dispExample} |
| 306 |
\mrcNPdef{nuremberg}{49.45522}{11.07631} |
| 307 |
Latitude: \mrcNPlat{nuremberg}\\ |
| 308 |
Longitude: \mrcNPlon{nuremberg} |
| 309 |
\end{dispExample} |
| 310 |
\end{docCommand} |
| 311 |
|
| 312 |
|
| 313 |
\begin{docCommand}[doc updated=2024-08-02]{mrcNPlon}{\marg{name}} |
| 314 |
Inserts the \emph{longitude} of a \emph{named position} with given \meta{name}. |
| 315 |
\refCom{mrcNPlon} is expandable and may be used in floating point expressions. |
| 316 |
If the \meta{name} does not exist, the macro expands to |0|. |
| 317 |
\end{docCommand} |
| 318 |
|
| 319 |
|
| 320 |
\begin{docCommand}[doc new=2024-08-02]{ifmrcNPexists}{\marg{name}\marg{true}\marg{false}} |
| 321 |
If the given \emph{named position} with given \meta{name} exists, the \meta{true} code is executed, otherwise |
| 322 |
the \meta{false} code. |
| 323 |
\end{docCommand} |
| 324 |
|
| 325 |
|
| 326 |
\clearpage |
| 327 |
%------------------------------------------------------------------------------- |
| 328 |
\subsection{Tests for Points to be inside or outside a Map} |
| 329 |
|
| 330 |
When a map is drawn, \refCom{mrcclipmap} can be used to set up a |
| 331 |
\tikzname\ clip environment which automatically removes all content which |
| 332 |
is not inside the defined map. However, the \tikzname\ position of a geographic |
| 333 |
point has to be computed first to decide, if this point is to be drawn. |
| 334 |
Since \TeX\ length registers do not allow large dimensions, compiler errors |
| 335 |
are possible to happen. |
| 336 |
|
| 337 |
The following tests check given geographic coordinates before they are |
| 338 |
transformed to \TeX\ dimensions and avoid such compiler errors. |
| 339 |
|
| 340 |
\begin{docCommand}{ifmrcinmap}{\marg{latitude}\marg{longitude}\marg{true}\marg{false}} |
| 341 |
If the given \meta{latitude} and \meta{longitude} describes a point |
| 342 |
inside the visible map, the \meta{true} code is executed, otherwise |
| 343 |
the \meta{false} code.\par |
| 344 |
Inside the \meta{true} code a \tikzname\ coordinate \docNode{mrcpos} |
| 345 |
describes the given point. Also, \docNode{mrclastpos} denotes the |
| 346 |
\emph{last} position before. |
| 347 |
\begin{dispListing} |
| 348 |
\ifmrcinmap{48.137222}{11.575556}{\fill (mrcpos) circle (2pt);}{} |
| 349 |
\end{dispListing} |
| 350 |
\end{docCommand} |
| 351 |
|
| 352 |
\begin{docCommand}{ifmrcNPinmap}{\marg{name}\marg{true}\marg{false}} |
| 353 |
If the given \emph{named position} (NP) \meta{name} describes a point |
| 354 |
inside the visible map, the \meta{true} code is executed, otherwise |
| 355 |
the \meta{false} code. |
| 356 |
\begin{dispListing} |
| 357 |
\mrcNPdef{munich}{48.137222}{11.575556} |
| 358 |
\ifmrcNPinmap{munich}{\fill (mrcpos) circle (2pt);}{} |
| 359 |
\end{dispListing} |
| 360 |
\end{docCommand} |
| 361 |
|
| 362 |
|
| 363 |
Very similar to \refCom{ifmrcinmap} is \refCom{ifmrcinvicinity}. |
| 364 |
|
| 365 |
\begin{docCommand}{ifmrcinvicinity}{\marg{latitude}\marg{longitude}\marg{true}\marg{false}} |
| 366 |
If the given \meta{latitude} and \meta{longitude} describes a point |
| 367 |
inside a vicinity of the visible map, i.e. the map \emph{plus} a margin of \refKey{mermap/vicinity}, |
| 368 |
the \meta{true} code is executed, otherwise |
| 369 |
the \meta{false} code.\par |
| 370 |
Inside the \meta{true} code a \tikzname\ coordinate \docNode{mrcpos} |
| 371 |
describes the given point. Also, \docNode{mrclastpos} denotes the |
| 372 |
\emph{last} position before.\par |
| 373 |
\refCom{ifmrcinvicinity} may be used for objects of a certain size like |
| 374 |
markers which could be partly visible even when their reference point |
| 375 |
is outside the visible map (but nearby). |
| 376 |
\begin{dispListing} |
| 377 |
\ifmrcinvicinity{48.137222}{11.575556}{\fill (mrcpos) circle (2pt);}{} |
| 378 |
\end{dispListing} |
| 379 |
\end{docCommand} |
| 380 |
|
| 381 |
|
| 382 |
\begin{docCommand}{ifmrcNPinvicinity}{\marg{name}\marg{true}\marg{false}} |
| 383 |
If the given \emph{named position} (NP) \meta{name} describes a point |
| 384 |
inside a vicinity of the visible map, the \meta{true} code is executed, otherwise |
| 385 |
the \meta{false} code, see \refCom{ifmrcinvicinity}. |
| 386 |
\begin{dispListing} |
| 387 |
\mrcNPdef{munich}{48.137222}{11.575556} |
| 388 |
\ifmrcNPinvicinity{munich}{\fill (mrcpos) circle (2pt);}{} |
| 389 |
\end{dispListing} |
| 390 |
\end{docCommand} |
| 391 |
|
| 392 |
|
| 393 |
\begin{docMrcKey}{vicinity}{=\meta{width}}{no default, initially |2cm|} |
| 394 |
The vicinity of the map is the given map plus a border in all directions |
| 395 |
with the given \meta{width}. |
| 396 |
\end{docMrcKey} |
| 397 |
|
| 398 |
|
| 399 |
\clearpage |
| 400 |
%------------------------------------------------------------------------------- |
| 401 |
\subsection{Formatted Coordinate Output} |
| 402 |
|
| 403 |
\begin{docCommand}{mrcformlat}{\oarg{options}\marg{latitude}} |
| 404 |
Formatted output for a given \meta{latitude} following given \meta{options}. |
| 405 |
Formatting \meta{options} are described in the following. |
| 406 |
\begin{dispExample} |
| 407 |
Latitude from \mrcformlat{-24.29} to \mrcformlat{12.3456789}. |
| 408 |
\end{dispExample} |
| 409 |
\end{docCommand} |
| 410 |
|
| 411 |
\begin{docCommand}{mrcformlon}{\oarg{options}\marg{longitude}} |
| 412 |
Formatted output for a given \meta{longitude} following given \meta{options}. |
| 413 |
Formatting \meta{options} are described in the following. |
| 414 |
\begin{dispExample} |
| 415 |
Longitude from \mrcformlon{-24.29} to \mrcformlon{12.3456789}. |
| 416 |
\end{dispExample} |
| 417 |
\end{docCommand} |
| 418 |
|
| 419 |
|
| 420 |
\begin{docMrcKey}{format angle}{=\meta{type}}{no default, initially |decimal-4|} |
| 421 |
The \meta{type} defines some formatting settings for |
| 422 |
\refCom{mrcformlat} and \refCom{mrcformlon}. Internally, the |\ang| macro |
| 423 |
from package |siunitx| \cite{package:siunitx} is used which can be controlled by further settings |
| 424 |
of |siunitx| like digit grouping or changing the decimal marker.\par |
| 425 |
Feasible values for \meta{type} are |
| 426 |
\begin{itemize} |
| 427 |
\item\docValue{decimal}: decimal output without rounding. |
| 428 |
\begin{dispExample} |
| 429 |
\mermapset{format angle=decimal} |
| 430 |
Longitude from \mrcformlon{-24.29} to \mrcformlon{12.3456789}. |
| 431 |
\end{dispExample} |
| 432 |
\item\docValue{decimal-0}: decimal output with rounding to full degrees. |
| 433 |
\begin{dispExample} |
| 434 |
\mermapset{format angle=decimal-0} |
| 435 |
Longitude from \mrcformlon{-24.29} to \mrcformlon{12.3456789}. |
| 436 |
\end{dispExample} |
| 437 |
\item\docValue{decimal-1}: decimal output with rounding to one place. |
| 438 |
\begin{dispExample} |
| 439 |
\mermapset{format angle=decimal-1} |
| 440 |
Longitude from \mrcformlon{-24.29} to \mrcformlon{12.3456789}. |
| 441 |
\end{dispExample} |
| 442 |
\item\docValue{decimal-2}: decimal output with rounding to two places. |
| 443 |
\begin{dispExample} |
| 444 |
\mermapset{format angle=decimal-2} |
| 445 |
Longitude from \mrcformlon{-24.29} to \mrcformlon{12.3456789}. |
| 446 |
\end{dispExample} |
| 447 |
\pagebreak |
| 448 |
\item\docValue{decimal-3}: decimal output with rounding to three places. |
| 449 |
\begin{dispExample} |
| 450 |
\mermapset{format angle=decimal-3} |
| 451 |
Longitude from \mrcformlon{-24.29} to \mrcformlon{12.3456789}. |
| 452 |
\end{dispExample} |
| 453 |
\item\docValue{decimal-4}: decimal output with rounding to four places. |
| 454 |
\begin{dispExample} |
| 455 |
\mermapset{format angle=decimal-4} |
| 456 |
Longitude from \mrcformlon{-24.29} to \mrcformlon{12.3456789}. |
| 457 |
\end{dispExample} |
| 458 |
\item\docValue{degree}: output with rounding to full degrees. |
| 459 |
This is an alias for \docValue{decimal-0}. |
| 460 |
\begin{dispExample} |
| 461 |
\mermapset{format angle=degree} |
| 462 |
Longitude from \mrcformlon{-24.29} to \mrcformlon{12.3456789}. |
| 463 |
\end{dispExample} |
| 464 |
\item\docValue{minute}: output with rounding to degrees and full minutes. |
| 465 |
\begin{dispExample} |
| 466 |
\mermapset{format angle=minute} |
| 467 |
Longitude from \mrcformlon{-24.29} to \mrcformlon{12.3456789}. |
| 468 |
\end{dispExample} |
| 469 |
\item\docValue{second}: output with rounding to degrees, minutes, and full seconds. |
| 470 |
\begin{dispExample} |
| 471 |
\mermapset{format angle=second} |
| 472 |
Longitude from \mrcformlon{-24.29} to \mrcformlon{12.3456789}. |
| 473 |
\end{dispExample} |
| 474 |
\end{itemize} |
| 475 |
\end{docMrcKey} |
| 476 |
|
| 477 |
|
| 478 |
\begin{docMrcKey}{format south}{=\meta{code}}{no default, initially \texttt{\#1\textbackslash,S}} |
| 479 |
Defines the format \meta{code} for a negative latitude. |
| 480 |
Use \texttt{\#1} to place the number (without sign). |
| 481 |
\begin{dispExample} |
| 482 |
\mermapset{format south={$-#1$}} |
| 483 |
Latitude \mrcformlat{-24.29}. |
| 484 |
\end{dispExample} |
| 485 |
\end{docMrcKey} |
| 486 |
|
| 487 |
\begin{docMrcKey}{format north}{=\meta{code}}{no default, initially \texttt{\#1\textbackslash,N}} |
| 488 |
Defines the format \meta{code} for a non-negative latitude. |
| 489 |
Use \texttt{\#1} to place the number. |
| 490 |
\begin{dispExample} |
| 491 |
\mermapset{format north={#1 North}} |
| 492 |
Latitude \mrcformlat{12.3456789}. |
| 493 |
\end{dispExample} |
| 494 |
\end{docMrcKey} |
| 495 |
|
| 496 |
\pagebreak |
| 497 |
\begin{docMrcKey}{format east}{=\meta{code}}{no default, initially \texttt{\#1\textbackslash,E}} |
| 498 |
Defines the format \meta{code} for a positive longitude. |
| 499 |
Use \texttt{\#1} to place the number (without sign). |
| 500 |
\begin{dispExample} |
| 501 |
\mermapset{format east={#1\,O}} |
| 502 |
\sisetup{output-decimal-marker={,}} |
| 503 |
L\"angengrad \mrcformlon{12.3456789}. |
| 504 |
\end{dispExample} |
| 505 |
\end{docMrcKey} |
| 506 |
|
| 507 |
\begin{docMrcKey}{format west}{=\meta{code}}{no default, initially \texttt{\#1\textbackslash,W}} |
| 508 |
Defines the format \meta{code} for a negative longitude. |
| 509 |
Use \texttt{\#1} to place the number. |
| 510 |
\begin{dispExample} |
| 511 |
\mermapset{format west={West: #1}} |
| 512 |
Longitude \mrcformlon{-24.29}. |
| 513 |
\end{dispExample} |
| 514 |
\end{docMrcKey} |
| 515 |
|
| 516 |
|
| 517 |
\begin{docMrcKey}{format NEWS numeric}{}{no value} |
| 518 |
Defines the format for north, east, west, and south as numeric value |
| 519 |
without N, E, W, S. |
| 520 |
\begin{dispExample} |
| 521 |
\mermapset{format NEWS numeric} |
| 522 |
Longitude \mrcformlon{-24.29} and \mrcformlon{12.3456789}.\\ |
| 523 |
Latitude \mrcformlat{-24.29} and \mrcformlat{12.3456789}. |
| 524 |
\end{dispExample} |
| 525 |
\end{docMrcKey} |
| 526 |
|
| 527 |
|
| 528 |
\begin{docMrcKey}{format NEWS absolute}{}{no value} |
| 529 |
Defines the format for north, east, west, and south as absolute value |
| 530 |
without N, E, W, S and without algebraic sign. |
| 531 |
\begin{dispExample} |
| 532 |
\mermapset{format NEWS absolute} |
| 533 |
Longitude \mrcformlon{-24.29} and \mrcformlon{12.3456789}.\\ |
| 534 |
Latitude \mrcformlat{-24.29} and \mrcformlat{12.3456789}. |
| 535 |
\end{dispExample} |
| 536 |
\end{docMrcKey} |
| 537 |
|