Debian Codegraph @

texmf-dist/doc/latex/mercatormap/mercatormap.doc.scales.tex

raw
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{Scales and Sizes}%
7
8 Inside a defined map several size values and scaling options are
9 available. Please note that due to the nature of the Mercator projection and several
10 simplifying assumptions all specifications for map scale, map width, map height,
11 etc. are imprecise in the best case and even misleading in the worst case.
12 They are suited for representative diagrams,
13 but not for critical navigation purposes etc.
14
15 \subsection{Map Sizes and Document Sizes}
16
17 \begin{docCommand}{mrctexwidth}{}
18 \TeX\ length denoting the document width of the current map.
19 \end{docCommand}
20
21 \begin{docCommand}{mrctexheight}{}
22 \TeX\ length denoting the document width of the current map.
23 \end{docCommand}
24
25 \begin{docCommand}{mrcscale}{}
26 Scaling factor between map and real world.
27 A \TeX\ length given in |pt|, but stripped from that unit,
28 multiplied by \refCom{mrcscale} corresponds to a real world length
29 given in kilometers.
30 Note that this is \emph{not} the map scale.
31 Actually, it is reciprocal proportional to the map scale
32 and proportional to the map scale denominator, see \refCom{mrcmapscaledenominator}.
33 \end{docCommand}
34
35 \begin{docCommand}{mrctextokm}{\marg{length}}
36 Computes a given \TeX\ \meta{length} (with unit) into the corresponding
37 real world length in kilometers (without unit).
38 \begin{dispListing}
39 Map width: \mrctextokm{\mrctexwidth}\,km
40 \end{dispListing}
41 \end{docCommand}
42
43 \begin{docCommand}{mrctextomile}{\marg{length}}
44 Computes a given \TeX\ \meta{length} (with unit) into the corresponding
45 real world length in miles (without unit).
46 \begin{dispListing}
47 Map width: \mrctextomile{\mrctexwidth}\,mi
48 \end{dispListing}
49 \end{docCommand}
50
51 \begin{docCommand}{mrckmtotex}{\marg{number}}
52 Computes real world length \meta{number} in kilometers (without unit)
53 to a \TeX\ length (with unit).
54 \begin{dispListing}
55 % draw a circle with radius 20km
56 \draw (mrcpos) circle (\mrckmtotex{20});
57 \end{dispListing}
58 \end{docCommand}
59
60 \begin{docCommand}{mrcmiletotex}{\marg{number}}
61 Computes real world length \meta{number} in miles (without unit)
62 to a \TeX\ length (with unit).
63 \begin{dispListing}
64 % draw a circle with radius 20 miles
65 \draw (mrcpos) circle (\mrcmiletotex{20});
66 \end{dispListing}
67 \end{docCommand}
68
69 \begin{docCommand}{mrcmapscaledenominator}{}
70 Approximate map scale denominator.
71 \SI{1}{cm} on the map corresponds approximately to
72 \mbox{\refCom{mrcmapscaledenominator}$\cdot$\SI{1}{cm}} in the real world.
73 Do not confuse with \refCom{mrcscale}.
74 \begin{dispListing}
75 Map scale: 1:\mrcmapscaledenominator
76 \end{dispListing}
77 \end{docCommand}
78
79
80 \subsection{Pretty Size Output}
81
82
83 \begin{docCommand}{mrcprettymapscale}{}
84 Approximate map scale given with three valid digits
85 with a representation like |1:1000|.
86 \begin{dispListing}
87 Map scale: \mrcprettymapscale
88 \end{dispListing}
89 \end{docCommand}
90
91 \begin{docCommand}{mrcprettymapwidth}{}
92 Approximate map width in kilometers (or meters) with three valid digits:
93 \begin{dispListing}
94 Map width: \mrcprettymapwidth
95 \end{dispListing}
96 To create a pretty printing to your own liking, you can do like the
97 following:
98 \begin{dispListing}
99 \newcommand{\myprettymapwidth}{\SI[round-mode=figures,round-precision=3]%
100 {\mrctextokm{\mrctexwidth}}{km}}
101 \end{dispListing}
102 \end{docCommand}
103
104 \begin{docCommand}{mrcprettymapheight}{}
105 Approximate map height in kilometers (or meters) with three valid digits:
106 \begin{dispListing}
107 Map height: \mrcprettymapheight
108 \end{dispListing}
109 \end{docCommand}
110
111
112 \begin{docCommand}{mrcprettymapresolution}{}
113 Approximate map resolution in dpi (dots per inch):
114 \begin{dispListing}
115 Map resolution: \mrcprettymapresolution
116 \end{dispListing}
117 \end{docCommand}
118
119 \begin{docCommand}{mrcprettytilesize}{}
120 Approximate tile size inside the document (\TeX\ size) in millimeters:
121 \begin{dispListing}
122 \TeX\ tile size: \mrcprettytilesize
123 \end{dispListing}
124 \end{docCommand}
125
126
127 \tikzsetnextfilename{scales_example}%
128 \begin{dispExample}
129 \begin{tikzpicture}
130 \mrcNPdef{rome}{41.89300}{12.48557}
131 \mermapset{named flex scale=2000000:rome}
132 \mrcmap[type=reference, named position=rome, source=topplusopen web,
133 tex width=\linewidth, tex height=10cm]{scales_example}
134 \mrcdrawmap
135 \node[below,font=\fontsize{7pt}{7pt}\sffamily] at (mrcmap.south)
136 {\mrcmapattribution};
137 \mrcclipmap
138 \path[draw] (\mrcNPcs{rome}) circle (\mrckmtotex{50});
139 \node[above] at ([yshift=\mrckmtotex{50}]\mrcNPcs{rome}) {\SI{50}{km}};
140 \node[above right,fill=white,fill opacity=0.5,text opacity=1,align=center,
141 line width=0pt, inner sep=2mm]
142 at (mrcmap.south west) { \begin{tabular}{rl}
143 scale: & \mrcprettymapscale\\
144 map width: & \mrcprettymapwidth\\
145 map height: & \mrcprettymapheight\\
146 \TeX\ tile size: & \mrcprettytilesize\\
147 resolution: & \mrcprettymapresolution
148 \end{tabular}\\
149 \begin{tikzpicture}
150 \mrcdrawscalebar[width-in-km=100]
151 \path[every node/.style={above,inner sep=0.5mm,font=\sffamily\tiny}]
152 (mrcscalebar.north west) -- (mrcscalebar.north east)
153 node[pos=0]{0} node[pos=0.2]{20} node[pos=0.4]{40} node[pos=0.6]{60}
154 node[pos=0.8]{80} node[pos=1]{100} node[pos=1,right,yshift=-1mm]{km};
155 \end{tikzpicture}
156 };
157 \end{tikzpicture}
158 \end{dispExample}
159
160
161 \clearpage
162 \subsection{Scale Bars}
163
164
165 \begin{docCommand}{mrcdrawscalebar}{\oarg{options}}
166 Draws a scale bar according to the given \meta{options}.
167 All \meta{options} share the common prefix |mermap/scalebar/|.
168 The most essential option is the \emph{width} of the scale bar.
169
170 \tikzsetnextfilename{scales_scalebar1}
171 \begin{dispExample}
172 \begin{tikzpicture}
173 \mrcNPdef{munich}{48.137222}{11.575556}
174 \mrcNPdef{vienna}{48.208333}{16.373056}
175 \mrcmap[tex width=\linewidth, tex height=4cm, target=none,
176 type=areafit, area={munich,vienna}, flex area fit=2cm]{scalebar1}
177 \mrcdrawmap
178 \mrcmarker{named position=munich, contents={M\"unchen}}
179 \mrcmarker{named position=vienna, contents={Wien}}
180 \mrcdrawscalebar[width-in-km=100, solid,
181 at={([xshift=-10mm,yshift=5mm]mrcmap.south east)},
182 placement={above left}, ]
183 \end{tikzpicture}
184 \end{dispExample}
185
186 The size, position, and appearance of the scale bar can be customized by
187 setting the various \meta{options}. The shape of the scale bar
188 is denoted by a \tikzname\ node \docNode{mrcscalebar} which can be used
189 for lettering.
190
191 \enlargethispage*{1cm}
192 \tikzsetnextfilename{scales_scalebar2}
193 \begin{dispExample}
194 \begin{tikzpicture}
195 \mrcNPdef{munich}{48.137222}{11.575556}
196 \mrcNPdef{vienna}{48.208333}{16.373056}
197 \mrcmap[tex width=\linewidth, tex height=4cm, target=none,
198 type=areafit, area={munich,vienna}, flex area fit=2cm]{scalebar2}
199 \mrcdrawmap
200 \mrcmarker{named position=munich, contents={M\"unchen}}
201 \mrcmarker{named position=vienna, contents={Wien}}
202 \mrcdrawscalebar[width-in-km=100,solid,south-west-inside=10mm;3mm ]
203 \path[every node/.style={above,inner sep=0.5mm,font=\sffamily\tiny}]
204 (mrcscalebar.north west) -- (mrcscalebar.north east)
205 node[pos=0]{0} node[pos=0.2]{20} node[pos=0.4]{40} node[pos=0.6]{60}
206 node[pos=0.8]{80} node[pos=1]{100} node[pos=1,right,yshift=-1mm]{km};
207 \end{tikzpicture}
208 \end{dispExample}
209 \end{docCommand}
210
211 \clearpage
212
213 \begin{docMrcKey}[scalebar]{width-in-km}{=\meta{number}}{no default, initially |0|}
214 Sets the width of the scale bar to match the real word length \meta{number}
215 in kilometers.
216 \end{docMrcKey}
217
218 \begin{docMrcKey}[scalebar]{width-in-kilometer}{=\meta{number}}{no default, initially |0|}
219 Alias for \refKey{mermap/scalebar/width-in-km}
220 \end{docMrcKey}
221
222 \begin{docMrcKey}[scalebar]{width-in-meter}{=\meta{number}}{no default, initially |0|}
223 Sets the width of the scale bar to match the real word length \meta{number}
224 in meters.
225 \end{docMrcKey}
226
227 \begin{docMrcKey}[scalebar]{width-in-mile}{=\meta{number}}{no default, initially |0|}
228 Sets the width of the scale bar to match the real word length \meta{number}
229 in miles.
230 \end{docMrcKey}
231
232 \begin{docMrcKey}[scalebar]{width-in-yard}{=\meta{number}}{no default, initially |0|}
233 Sets the width of the scale bar to match the real word length \meta{number}
234 in yards.
235 \end{docMrcKey}
236
237 \begin{docMrcKey}[scalebar]{partitions}{=\meta{number}}{no default, initially |5|}
238 Determines the \meta{number} of partitions for the scale bar. If \meta{number}
239 is set to 1, there is no partitioning.
240 \end{docMrcKey}
241
242 \begin{docMrcKey}[scalebar]{height}{=\meta{length}}{no default, initially |2mm|}
243 Sets the height of the scale bar to the given \TeX\ \meta{length}.
244 \end{docMrcKey}
245
246
247 \begin{docMrcKey}[scalebar]{at}{=\marg{\tikzname\ coordinate}}{no default,
248 initially \texttt{\brackets{(0,0)}}}
249 The scale bar is positioned at the given \meta{\tikzname\ coordinate}.
250 The placement is done with the \refKey{mermap/scalebar/placement} option.
251 Both option correspond to the \tikzname\ options for positioning nodes.
252 The scale bar can be positioned outside the map (e.g. below), but
253 remember to use \refCom{mrcclipmap} \emph{after} the scale bar
254 in this case, if needed.
255
256 % \begin{dispListing}
257 % \mrcdrawscalebar[
258 % at = {([xshift=-10mm,yshift=5mm]mrcmap.south east)},
259 % placement = above left,
260 % ]
261 % \end{dispListing}
262
263 \tikzsetnextfilename{scales_scalebar3}
264 \begin{dispExample}
265 \begin{tikzpicture}
266 \mrcNPdef{munich}{48.137222}{11.575556}
267 \mrcNPdef{vienna}{48.208333}{16.373056}
268 \mrcmap[tex width=\linewidth, tex height=4cm, target=none,
269 type=areafit, area={munich,vienna}, flex area fit=2cm]{scalebar3}
270 \mrcdrawmap
271 \mrcmarker{named position=munich, contents={M\"unchen}}
272 \mrcmarker{named position=vienna, contents={Wien}}
273 \mrcdrawscalebar[width-in-km=200, partitions=8,
274 at={([xshift=5mm,yshift=-2mm]mrcmap.south west)},
275 placement=below right ]
276 \path[every node/.style={below,inner sep=0.5mm,font=\sffamily\tiny}]
277 (mrcscalebar.south west) -- (mrcscalebar.south east)
278 node[pos=0]{0} node[pos=0.25]{50} node[pos=0.5]{100} node[pos=0.75]{150}
279 node[pos=1]{200} node[pos=1,right,yshift=1mm]{km};
280 \end{tikzpicture}
281 \end{dispExample}
282 \end{docMrcKey}
283
284 \pagebreak
285
286 \begin{docMrcKey}[scalebar]{placement}{=\meta{\tikzname\ positioning}}{no default, initially empty}
287 \meta{\tikzname\ positioning} of a scale bar in combination with
288 \refKey{mermap/scalebar/at}. All \tikzname\ placement options for nodes
289 can be used, e.g. \texttt{above left} or \texttt{anchor=mid west}, etc.
290 Actually, \emph{any} node option could be applied here, but the intended use
291 is for placement options only.
292 \end{docMrcKey}
293
294
295 \begin{docMrcKey}[scalebar]{south-east-inside}{\colOpt{=\meta{x shift};\meta{y shift}}}{default |0pt;0pt|, initially unset}
296 Shortcut for placing the scale bar at the south east corner of the map.
297 The optional \mbox{\meta{x shift}} and \meta{y shift} denote the
298 absolute shift values in each direction, i.e. the algebraic sign is
299 automatically complemented.
300 If only \meta{x shift} is given, then \meta{y shift} is set
301 to the same value. \refKey{mermap/scalebar/at} and \refKey{mermap/scalebar/placement}
302 are set by this option.
303 \end{docMrcKey}
304
305 \begin{docMrcKey}[scalebar]{south-east-outside}{\colOpt{=\meta{x shift};\meta{y shift}}}{default |0pt;0pt|, initially unset}
306 Shortcut for placing the scale bar below the south east corner of the map.
307 \end{docMrcKey}
308
309 \begin{docMrcKey}[scalebar]{south-west-inside}{\colOpt{=\meta{x shift};\meta{y shift}}}{default |0pt;0pt|, initially unset}
310 Shortcut for placing the scale bar at the south west corner of the map.
311 \end{docMrcKey}
312
313 \begin{docMrcKey}[scalebar]{south-west-outside}{\colOpt{=\meta{x shift};\meta{y shift}}}{default |0pt;0pt|, initially unset}
314 Shortcut for placing the scale bar below the south west corner of the map.
315 \end{docMrcKey}
316
317 \begin{docMrcKey}[scalebar]{north-west-inside}{\colOpt{=\meta{x shift};\meta{y shift}}}{default |0pt;0pt|, initially unset}
318 Shortcut for placing the scale bar at the north west corner of the map.
319 \end{docMrcKey}
320
321 \begin{docMrcKey}[scalebar]{north-west-outside}{\colOpt{=\meta{x shift};\meta{y shift}}}{default |0pt;0pt|, initially unset}
322 Shortcut for placing the scale bar above the north west corner of the map.
323 \end{docMrcKey}
324
325 \begin{docMrcKey}[scalebar]{north-east-inside}{\colOpt{=\meta{x shift};\meta{y shift}}}{default |0pt;0pt|, initially unset}
326 Shortcut for placing the scale bar at the north east corner of the map.
327 \end{docMrcKey}
328
329 \begin{docMrcKey}[scalebar]{north-east-outside}{\colOpt{=\meta{x shift};\meta{y shift}}}{default |0pt;0pt|, initially unset}
330 Shortcut for placing the scale bar above the north east corner of the map.
331 \end{docMrcKey}
332
333
334 \begin{docMrcKey}[scalebar]{major style}{=\marg{\tikzname\ options}}{no default, initially empty}
335 The \emph{major} part of the scale bar is a single \tikzname\ path object
336 which can be customized by the given \meta{\tikzname\ options}.
337 The \emph{major} part consists of the black area in the default case.
338 \tikzsetnextfilename{scales_scalebar4}
339 \begin{dispExample}
340 \begin{tikzpicture}
341 \mrcdrawscalebar[scale=2000000, width-in-km=100,
342 major style={left color=red,right color=blue} ]
343 \end{tikzpicture}
344 \end{dispExample}
345 \end{docMrcKey}
346
347
348 \begin{docMrcKey}[scalebar]{minor style}{=\marg{\tikzname\ options}}{no default, initially empty}
349 The \emph{minor} part of the scale bar is a single \tikzname\ path object
350 which can be customized by the given \meta{\tikzname\ options}.
351 The \emph{minor} part is seen as holes in the default case.
352 \refKey{mermap/scalebar/minor style} has only an effect, if
353 the minor part is drawn \refKey{mermap/scalebar/solid}.
354 \tikzsetnextfilename{scales_scalebar5}
355 \begin{dispExample}
356 \begin{tikzpicture}
357 \mrcdrawscalebar[scale=2000000, width-in-km=100, solid,
358 minor style={yellow} ]
359 \end{tikzpicture}
360 \end{dispExample}
361 \end{docMrcKey}
362
363
364 \pagebreak
365 \begin{docMrcKey}[scalebar]{double}{\colOpt{=true\textbar false}}{default |true|, initially |true|}
366 If set to |true|, the scale bar is drawn as a double ruler.
367 \end{docMrcKey}
368
369
370 \begin{docMrcKey}[scalebar]{single}{\colOpt{=true\textbar false}}{default |true|, initially |false|}
371 If set to |true|, the scale bar is drawn as a single ruler.
372 \refKey{mermap/scalebar/single} is inverse to \refKey{mermap/scalebar/double}.
373 \tikzsetnextfilename{scales_scalebar6}
374 \begin{dispExample}
375 \begin{tikzpicture}
376 \mrcdrawscalebar[scale=2000000, width-in-km=100, single, height=1mm]
377 \end{tikzpicture}
378 \end{dispExample}
379 \end{docMrcKey}
380
381
382 \begin{docMrcKey}[scalebar]{transparent}{\colOpt{=true\textbar false}}{default |true|, initially |true|}
383 If set to |true|, the \emph{minor} part of the scale bar is drawn transparent,
384 i.e. as holes inside the ruler.
385 \end{docMrcKey}
386
387
388 \begin{docMrcKey}[scalebar]{solid}{\colOpt{=true\textbar false}}{default |true|, initially |false|}
389 If set to |true|, the \emph{minor} part of the scale bar is drawn opaque.
390 It is drawn white or according to \refKey{mermap/scalebar/minor style}.
391 \refKey{mermap/scalebar/solid} is inverse to \refKey{mermap/scalebar/transparent}.
392 \end{docMrcKey}
393
394
395 \begin{docMrcKey}[scalebar]{scale}{=\meta{scale denominator}}{no default, initially unset}
396 Sets or overwrites the \meta{scale denominator} setting.
397 \textbf{Using this key is not needed and may even lead to erroneous displays
398 inside a |tikzpicture| with a defined map setting.}
399 This key is helpful, if a scale bar is used without a defined map.
400 \end{docMrcKey}
401