1map::slippy(n) Mapping utilities map::slippy(n)
2
3
4
5______________________________________________________________________________
6
8 map::slippy - Common code for slippy based map packages
9
11 package require Tcl 8.4
12
13 package require Tk 8.4
14
15 package require map::slippy ?0.2?
16
17 ::map::slippy length level
18
19 ::map::slippy tiles level
20
21 ::map::slippy tile size
22
23 ::map::slippy tile valid tile levels ?msgvar?
24
25 ::map::slippy geo 2tile geo
26
27 ::map::slippy geo 2point geo
28
29 ::map::slippy tile 2geo tile
30
31 ::map::slippy tile 2point tile
32
33 ::map::slippy point 2geo point
34
35 ::map::slippy point 2tile point
36
37_________________________________________________________________
38
40 This package provides a number of methods doing things needed by all
41 types of slippy-based map packages.
42
44 ::map::slippy length level
45 This method returns the width/height of a slippy-based map at
46 the specified zoom level, in pixels. This is, in essence, the
47 result of
48
49 expr { [tiles $level] * [tile size] }
50
51
52 ::map::slippy tiles level
53 This method returns the width/height of a slippy-based map at
54 the specified zoom level, in tiles.
55
56 ::map::slippy tile size
57 This method returns the width/height of a tile in a slippy-based
58 map, in pixels.
59
60 ::map::slippy tile valid tile levels ?msgvar?
61 This method checks whether tile described a valid tile in a
62 slippy-based map containing that many zoom levels. The result is
63 a boolean value, true if the tile is valid, and false otherwise.
64 For the latter a message is left in the variable named by msg‐
65 var, should it be specified.
66
67 A tile identifier as stored in tile is a list containing zoom
68 level, tile row, and tile column, in this order. The command
69 essentially checks this, i.e. the syntax, that the zoom level is
70 between 0 and "levels-1", and that the row/col information is
71 within the boundaries for the zoom level, i.e. 0 ... "[tiles
72 $zoom]-1".
73
74 ::map::slippy geo 2tile geo
75 Converts a geographical location at a zoom level (geo, a list
76 containing zoom level, latitude, and longitude, in this order)
77 to a tile identifier (list containing zoom level, row, and col‐
78 umn) at that level.
79
80 ::map::slippy geo 2point geo
81 Converts a geographical location at a zoom level (geo, a list
82 containing zoom level, latitude, and longitude, in this order)
83 to a pixel position (list containing zoom level, y, and x) at
84 that level.
85
86 ::map::slippy tile 2geo tile
87 Converts a tile identifier at a zoom level (tile, list contain‐
88 ing zoom level, row, and column) to a geographical location
89 (list containing zoom level, latitude, and longitude, in this
90 order) at that level.
91
92 ::map::slippy tile 2point tile
93 Converts a tile identifier at a zoom level (tile, a list con‐
94 taining zoom level, row, and column, in this order) to a pixel
95 position (list containing zoom level, y, and x) at that level.
96
97 ::map::slippy point 2geo point
98 Converts a pixel position at a zoom level (point, list contain‐
99 ing zoom level, y, and x) to a geographical location (list con‐
100 taining zoom level, latitude, and longitude, in this order) at
101 that level.
102
103 ::map::slippy point 2tile point
104 Converts a pixel position at a zoom level (point, a list con‐
105 taining zoom level, y, and x, in this order) to a tile identi‐
106 fier (list containing zoom level, row, and column) at that
107 level.
108
110 [1] http://wiki.openstreetmap.org/wiki/Main_Page
111
113 geodesy, geography, latitute, location, longitude, map, slippy, zoom
114
115
116
117map 0.2 map::slippy(n)