| 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 Drawing} |
| 7 |
|
| 8 |
%------------------------------------------------------------------------------- |
| 9 |
\subsection{Principal Drawing} |
| 10 |
|
| 11 |
\begin{docCommand}{mrcdrawmap}{\oarg{options}} |
| 12 |
Inside a |tikzpicture| environment, \refCom{mrcdrawmap} draws a map |
| 13 |
prepared by \refCom{mrcdefinemap}, \refCom{mrcapplymap}, or \refCom{mrcmap}. |
| 14 |
All \meta{options} share the common prefix |mermap/|. |
| 15 |
This is the principal macro to draw a prepared map respectively |
| 16 |
the background of the map. The background consists of downloaded map tiles |
| 17 |
or just a color rectangle. |
| 18 |
\end{docCommand} |
| 19 |
|
| 20 |
\begin{docMrcKey}{draw}{=\meta{tile draw}}{no default, initially |auto|} |
| 21 |
\begin{itemize} |
| 22 |
\item\docValue{auto}: Draws the map according to \refKey{mermap/mapdef/resource}, |
| 23 |
i.e. downloaded maps or tiles are used, if available. |
| 24 |
\item\docValue{path}: Draws the map according to the style given by |
| 25 |
\refKey{mermap/map path}. Existing map tiles or merged maps are ignored |
| 26 |
\item\docValue{tiles}: Draws the map with downloaded map tiles, if |
| 27 |
available. |
| 28 |
\item\docValue{mergedmap}: Draws the map with a merged picture, if |
| 29 |
available. |
| 30 |
\item\docValue{wmsmap}: Draws the map with a downloaded WMS picture, if |
| 31 |
available. |
| 32 |
\end{itemize} |
| 33 |
\end{docMrcKey} |
| 34 |
|
| 35 |
\begin{docMrcKey}{map path}{=\meta{options}}{no default, initially |upper left=green!50,|\\|upper right=green!25, lower left=green!50!black!50, lower right=green!25|} |
| 36 |
Defines a \tikzname\ style for drawing the map without tiles. |
| 37 |
\meta{options} are feasible \tikzname\ path options. |
| 38 |
\end{docMrcKey} |
| 39 |
|
| 40 |
\begin{docMrcKey}{map clip}{=\meta{code}}{no default, initially \refCom{mrcclipmap}} |
| 41 |
Clipping options for the map. By default, the defined map is |
| 42 |
clipped with the full map rectangle. Use this option only, if you not want to clip |
| 43 |
the map to its specified size. \meta{code} is some \tikzname\ clipping code. |
| 44 |
\end{docMrcKey} |
| 45 |
|
| 46 |
\begin{docMrcKey}{map scope}{=\meta{options}}{no default, initially empty} |
| 47 |
\refCom{mrcdrawmap} uses a |scope| environment inside which takes |
| 48 |
the given \tikzname\ \meta{options}. |
| 49 |
\end{docMrcKey} |
| 50 |
|
| 51 |
|
| 52 |
\begin{docCommand}{mrcclipmap}{} |
| 53 |
Clips all subsequent drawings against the applied map.\\ |
| 54 |
This is a shortcut macro identical to |
| 55 |
\begin{dispListing} |
| 56 |
\path[clip] (mrcmap.south west) rectangle (mrcmap.north east); |
| 57 |
\end{dispListing} |
| 58 |
\end{docCommand} |
| 59 |
|
| 60 |
|
| 61 |
\begin{docCommand}{mrcboundmap}{} |
| 62 |
Sets the picture bounding box according to the applied map.\\ |
| 63 |
This is a shortcut macro identical to |
| 64 |
\begin{dispListing} |
| 65 |
\path[use as bounding box] |
| 66 |
(mrcmap.south west) rectangle (mrcmap.north east); |
| 67 |
\end{dispListing} |
| 68 |
\end{docCommand} |
| 69 |
|
| 70 |
|
| 71 |
\clearpage |
| 72 |
%------------------------------------------------------------------------------- |
| 73 |
\subsection{Flexible Tile Size}\label{sec:flexible_tile_size} |
| 74 |
|
| 75 |
Typically, the pixel size of a map tile is fixed and a map tile is a |
| 76 |
pixel graphics file. The actual size of such an included picture inside |
| 77 |
the document is freely selectable. Note that a very small |
| 78 |
\refKey{mermap/tile size} results in very small map lettering, |
| 79 |
while a very large \refKey{mermap/tile size} results results in |
| 80 |
very blurred images. |
| 81 |
|
| 82 |
The general idea of a \emph{flexible} tile size is to specify an aspired |
| 83 |
tile size called \refKey{mermap/flex tile size} and to give \LaTeX\ |
| 84 |
the freedom to select \refKey{mermap/tile size} in \emph{about the same size} |
| 85 |
as \refKey{mermap/flex tile size}. |
| 86 |
This freedom is used to achieve a \emph{pseudo zoom} called |
| 87 |
\refKey{mermap/flex zoom} which is a nearly arbitrary rational number instead |
| 88 |
of \refKey{mermap/supply/zoom} which is a natural number. |
| 89 |
|
| 90 |
This \emph{pseudo zoom} is applied by several options which share \emph{flex} |
| 91 |
in their names, e.g. |
| 92 |
\refKey{mermap/flex scale}, \refKey{mermap/named flex scale}, |
| 93 |
\refKey{mermap/supply/flex reference scale}, |
| 94 |
\refKey{mermap/supply/flex area scale}, |
| 95 |
\refKey{mermap/supply/flex area fit}. |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
\begin{docMrcKey}{tile size}{=\meta{length}}{no default, initially |32.512mm|} |
| 100 |
Width and height of a drawn tile picture are set to \meta{length}. |
| 101 |
For standard tiles with 256 times 256 pixels a tile size of |
| 102 |
\SI{32.512}{mm} = \SI{1.28}{in} results in an approximate |
| 103 |
\SI{200}{dpi} output for the document. |
| 104 |
For a |beamer| document, consider to use a \refKey{mermap/tile size} of |
| 105 |
\SI{21.333333}{mm} to get approximate 1:1 pixel input and output (depending on |beamer| settings |
| 106 |
and used hardware). Also see \refKey{mermap/mapdef/tile size}. |
| 107 |
\end{docMrcKey} |
| 108 |
|
| 109 |
\begin{docMrcKey}{flex tile size}{=\meta{length}}{no default, initially |32.512mm|} |
| 110 |
Aspired width and height of a tile picture are set to \meta{length}. |
| 111 |
This value is used while applying \refKey{mermap/flex zoom}. |
| 112 |
\end{docMrcKey} |
| 113 |
|
| 114 |
|
| 115 |
\begin{docMrcKey}{flex zoom}{=\meta{pseudo zoom}}{style, no default} |
| 116 |
This style sets \refKey{mermap/supply/zoom} and \refKey{mermap/tile size} in combination. |
| 117 |
\begin{itemize} |
| 118 |
\item |
| 119 |
If \meta{pseudo zoom} is a natural number, |
| 120 |
\refKey{mermap/supply/zoom} is set to \meta{pseudo zoom} and |
| 121 |
\refKey{mermap/tile size} is set to \refKey{mermap/flex tile size}. |
| 122 |
\item Otherwise, \refKey{mermap/supply/zoom} is set to the natural number |
| 123 |
closest to \meta{pseudo zoom} and \refKey{mermap/tile size} is such |
| 124 |
enlarged or reduced that the \meta{pseudo zoom} value is simulated, |
| 125 |
i.e. the \emph{impression} of a rational zoom factor is given. |
| 126 |
\end{itemize} |
| 127 |
Note that \refKey{mermap/flex zoom} has to be used \emph{before} |
| 128 |
\refCom{mrcsupplymap} or \refCom{mrcmap}, because the zoom setup is |
| 129 |
adapted. |
| 130 |
\end{docMrcKey} |
| 131 |
|
| 132 |
|
| 133 |
\clearpage |
| 134 |
\begin{docMrcKey}{flex scale}{=\meta{scale denominator}:\meta{latitude}}{style, no default} |
| 135 |
For different latitude scopes, an identical zoom factor produces maps of |
| 136 |
different scale. With \refKey{mermap/flex scale}, a \refKey{mermap/flex zoom} |
| 137 |
is computed to achieve the given \meta{scale denominator} at a given \meta{latitude}. |
| 138 |
Note that this only applies to the center of a map. If the produced |
| 139 |
map is not centered at \meta{latitude}, the produced scale may |
| 140 |
differ from the intended one. |
| 141 |
Also see \refKey{mermap/supply/flex reference scale}. |
| 142 |
|
| 143 |
\tikzsetnextfilename{drawing_flex_scale}% |
| 144 |
\begin{dispExample} |
| 145 |
\begin{tikzpicture} |
| 146 |
\mermapset{flex scale=250000:48.14} |
| 147 |
\mrcmap[type=reference,latitude=48.14,longitude=11.57, |
| 148 |
source=opentopomap, |
| 149 |
tex width=\linewidth,tex height=5cm]{flex_scale} |
| 150 |
\mrcdrawmap |
| 151 |
\node[below,font=\fontsize{7pt}{7pt}\sffamily] at (mrcmap.south) |
| 152 |
{\mrcmapattribution}; |
| 153 |
\mrcclipmap |
| 154 |
\path[draw] (mrcmap.south west) rectangle (mrcmap.north east); |
| 155 |
\node[below left=2mm, align=right, fill=white, fill opacity=0.5, |
| 156 |
text opacity=1] |
| 157 |
at (mrcmap.north east) {scale \mrcprettymapscale}; |
| 158 |
\end{tikzpicture} |
| 159 |
\end{dispExample} |
| 160 |
\end{docMrcKey} |
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
\begin{docMrcKey}{named flex scale}{=\meta{scale denominator}:\meta{name}}{style, no default} |
| 165 |
Identical to \refKey{mermap/flex scale}, but used the \emph{named position} |
| 166 |
\meta{name} to provide a \emph{latitude}, see \Fullref{sec:names_positions}. |
| 167 |
\begin{dispListing} |
| 168 |
\mrcNPdef{munich}{48.137222}{11.575556} |
| 169 |
\mermapset{named flex scale=250000:munich} % identical to the following |
| 170 |
\mermapset{flex scale=250000:\mrcNPlat{munich}} |
| 171 |
\end{dispListing} |
| 172 |
\end{docMrcKey} |
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
\clearpage |
| 177 |
%------------------------------------------------------------------------------- |
| 178 |
\subsection{Geodetic Network} |
| 179 |
|
| 180 |
\begin{docCommand}{mrcdrawnetwork}{\oarg{options}} |
| 181 |
Draws a geodetic network with meridians and parallels. |
| 182 |
All \meta{options} share the common prefix |mermap/|. |
| 183 |
The displayed lines are selected automatically according to some tuning |
| 184 |
parameters. |
| 185 |
The map is sliced in \emph{about} maximal \refKey{mermap/network pieces} in each |
| 186 |
direction. Meridians and parallels share a minimal distance of |
| 187 |
\emph{about} \refKey{mermap/network distance}. The algorithm is |
| 188 |
allowed to violate these conditions \emph{somewhat}. |
| 189 |
|
| 190 |
Note that oversized maps are not supported, i.e. maps which are wider |
| 191 |
than \ang{360} in longitude. Here, meridians are expected to be missing |
| 192 |
or misplaced. |
| 193 |
|
| 194 |
\tikzsetnextfilename{drawing_network}% |
| 195 |
\begin{dispExample*}{center lower} |
| 196 |
% \mrcsetapikey{thunderforest}{YOUR-API-KEY} % registered key |
| 197 |
\begin{tikzpicture} |
| 198 |
\mrcmap[ type = boundaries, |
| 199 |
west = -20, east = 40, south = 36, north = 65, |
| 200 |
source=thunderforest landscape, |
| 201 |
flex area scale=40 000 000 ]{drawing_network} |
| 202 |
\mrcdrawmap |
| 203 |
\node[below,font=\fontsize{7pt}{7pt}\sffamily] at (mrcmap.south) |
| 204 |
{\mrcmapattribution}; |
| 205 |
\mrcclipmap |
| 206 |
\mrcdrawnetwork |
| 207 |
\path[draw] (mrcmap.south west) rectangle (mrcmap.north east); |
| 208 |
\end{tikzpicture} |
| 209 |
\end{dispExample*} |
| 210 |
\end{docCommand} |
| 211 |
|
| 212 |
|
| 213 |
\begin{docMrcKey}{network pieces}{=\meta{number}}{no default, initially |8|} |
| 214 |
The map is sliced in \emph{about} maximal \meta{number} pieces in each |
| 215 |
direction. \meta{number} may be exceeded \emph{somewhat}. |
| 216 |
It is underrun to comply with \refKey{mermap/network distance}. |
| 217 |
\end{docMrcKey} |
| 218 |
|
| 219 |
|
| 220 |
\begin{docMrcKey}{network distance}{=\meta{mesh width}}{no default, initially |2cm|} |
| 221 |
Meridians and parallels share a minimal distance of |
| 222 |
\emph{about} \meta{mesh width}. |
| 223 |
\meta{mesh width} may be underrun \emph{somewhat}. |
| 224 |
It is exceeded to comply with \refKey{mermap/network pieces}. |
| 225 |
For parallels on small scale maps, it refers to an averaged mesh width. |
| 226 |
\end{docMrcKey} |
| 227 |
|
| 228 |
\begin{docMrcKey}{network font}{=\meta{text}}{no default, initially |
| 229 |
|\textbackslash fontsize\brackets{4pt}\brackets{4pt}\textbackslash sffamily|} |
| 230 |
\meta{text} is some font setting for the latitude and longitude display. |
| 231 |
\end{docMrcKey} |
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
\subsection{Graphical Debug Overlay} |
| 236 |
|
| 237 |
\begin{docCommand}{mrcdrawinfo}{} |
| 238 |
Draws some map information overlay for debugging purposes only. |
| 239 |
\tikzsetnextfilename{drawing_mrcdrawinfo}% |
| 240 |
\begin{dispExample} |
| 241 |
\begin{tikzpicture} |
| 242 |
\mrcNPdef{munich}{48.137222}{11.575556} |
| 243 |
\mrcmap[type=reference, named position=munich, source=opentopomap, |
| 244 |
flex reference scale=50000, |
| 245 |
tex width=\linewidth,tex height=10cm]{drawing_mrcdrawinfo} |
| 246 |
\mrcdrawmap |
| 247 |
\node[below,font=\fontsize{7pt}{7pt}\sffamily] at (mrcmap.south) |
| 248 |
{\mrcmapattribution}; |
| 249 |
\mrcclipmap |
| 250 |
\mrcdrawinfo |
| 251 |
\end{tikzpicture} |
| 252 |
\end{dispExample} |
| 253 |
\end{docCommand} |