::mapslippygeobox2pointzoomgeobox
The command converts the geographical box geobox to a point box in the canvas, for the specified
zoom level, and returns that box.
::mapslippygeoboxcentergeobox
The command returns the center of the geographical box geobox.
::mapslippygeoboxcornersgeobox
This command returns a list containing the four corner locations implied by the geographical box
geobox. The four points are top-left, bottom-left, top-right, and bottom-right, in that order.
::mapslippygeoboxdiametergeobox
The command returns the diameter of the geographical box geobox, in meters.
::mapslippygeoboxdimensionsgeobox
The command returns the dimensions of the geographical box geobox, width and height, in this
order.
::mapslippygeoboxfitgeoboxcanvdimzmax ?zmin?
This command calculates the zoom level such that the geobox will fit into a viewport given by
canvdim (a 2-element list containing the width and height of said viewport) and returns it.
The zoom level will be made to fit within the range zmin...zmax. When zmin is not specified it
will default to 0.
::mapslippygeoboxinsidegeoboxgeo
The command tests if the geographical location geo is contained in the geographical box geobox or
not. It returns true if so, and false else.
::mapslippygeoboxlimitgeobox
This command limits the geographical box to at most 6 decimals and returns the result.
For geographical coordinates 6 decimals is roughly equivalent to a grid of 11.1 cm.
::mapslippygeoboxoppositesgeobox
This command returns a list containing the two principal corner locations implied by the
geographical box geobox. The two points are top-left, and bottom-right, in that order.
::mapslippygeoboxperimetergeobox
The command returns the perimeter of the geographical box geobox, in meters.
::mapslippygeoboxvalidgeobox
This commands tests if the specified geographical box contains only valid latitudes and
longitudes. It returns true if the box is valid, and false else.
::mapslippygeoboxvalid-listgeoboxes
This commands tests if the list of geographical boxes contains only valid latitudes and
longitudes. It returns true if all the boxes are valid, and false else.
::mapslippygeodistancegeo1geo2
This command computes the great-circle distance between the two geographical locations in meters
and returns that value.
The code is based on https://wiki.tcl-lang.org/page/geodesy take on the haversineformula
[https://en.wikipedia.org/wiki/Haversine_formula].
::mapslippygeodistance*closedgeo...
An extension of mapslippygeodistance this command computes the cumulative distance along the
path specified by the ordered set of geographical locations in meters, and returns it.
If the path is marked as closed (i.e. a polygon/loop) the result contains the distance between
last and first element of the path as well, making the result the length of the perimeter of the
area described by the locations.
::mapslippygeodistance-listclosedgeo-list
As a variant of mapslippygeodistance* this command takes the path to compute the length of as a
single list of geographical locations, instead of a varying number of arguments.
::mapslippygeolimitgeo
This command limits the geographical location to at most 6 decimals and returns the result.
For geographical coordinates 6 decimals is roughly equivalent to a grid of 11.1 cm.
::mapslippygeobboxgeo...
::mapslippygeobbox-listgeo-list
These two commands compute the bounding box for the specified set of geographical locations and
return a geographical box.
When no geographical locations are specified the box is "0000".
The locations are specified as either a varying number of arguments, or as a single list.
::mapslippygeocentergeo...
::mapslippygeocenter-listgeo-list
These two commands compute the center of the bounding box for the specified set of geographical
locations.
When no geographical locations are specified the center is "00".
The locations are specified as either a varying number of arguments, or as a single list.
::mapslippygeodiametergeo...
::mapslippygeodiameter-listgeo-list
These two commands compute the diameter for the specified set of geographical locations, in
meters. The diameter is the maximum of the pair-wise distances between all locations.
When less than two geographical locations are specified the diameter is "0".
The locations are specified as either a varying number of arguments, or as a single list.
::mapslippygeo2pointzoomgeo
This command converts the geographical location geo to a point in the canvas, for the specified
zoom level, and returns that point.
::mapslippygeo2point*zoomgeo...
::mapslippygeo2point-listzoomgeo-list
These two commands are extensions of mapslippygeo2point which take a series of geographical
locations as either a varying number of arguments or a single list, convert them all to points as
per the specified zoom level and return a list of the results.
::mapslippygeovalidgeo
This commands tests if the specified geographical location contains only valid latitudes and
longitudes. It returns true if the location is valid, and false else.
::mapslippygeovalid-listgeos
This commands tests if the list of geographical locations contains only valid latitudes and
longitudes. It returns true if all the locations are valid, and false else.
::mapslippylengthlevel
This command returns the width/height of a slippy-based map at the specified zoom level, in
pixels. This is, in essence, the result of
expr { [tiles $level] * [tile size] }
::mapslippylimit2x::mapslippylimit3x::mapslippylimit6x
This command limits the value to at most 2, 3, or 6 decimals and returns the result.
For geographical coordinates 6 decimals is roughly equivalent to a grid of 11.1 cm.
::mapslippypointbox2geozoompointbox
The command converts the point box pointbox to a geographical box in the canvas, as per the
specified zoom level, and returns that box.
::mapslippypointboxcenterpointbox
The command returns the center of the pointbox.
::mapslippypointboxcornerspointbox
This command returns a list containing the four corner locations implied by the point box
pointbox. The four points are top-left, bottom-left, top-right, and bottom-right, in that order.
::mapslippypointboxdiameterpointbox
The command returns the diameter of the pointbox, in pixels.
::mapslippypointboxdimensionspointbox
The command returns the dimensions of the pointbox, width and height, in this order.
::mapslippypointboxinsidepointboxpoint
The command tests if the point is contained in the pointbox or not. It returns true if so, and
false else.
::mapslippypointboxoppositespointbox
This command returns a list containing the two principal corner locations implied by the point box
pointbox. The two points are top-left, and bottom-right, in that order.
::mapslippypointboxperimeterpointbox
The command returns the perimeter of the pointbox, in pixels.
::mapslippypointdistancepoint1point2
This command computes the euclidena distance between the two points in pixels and returns that
value.
::mapslippypointdistance*closedpoint...
An extension of mapslippypointdistance this command computes the cumulative distance along the
path specified by the ordered set of points, and returns it.
If the path is marked as closed (i.e. a polygon/loop) the result contains the distance between
last and first element of the path as well, making the result the length of the perimeter of the
area described by the locations.
::mapslippypointdistance-listclosedpoint-list
As a variant of mapslippypointdistance* this command takes the path to compute the length of as
a single list of points, instead of a varying number of arguments.
::mapslippypointbboxpoint...
::mapslippypointbbox-listpoint-list
These two commands compute the bounding box for the specified set of points and return a point
box.
When no points are specified the box is "0000".
The locations are specified as either a varying number of arguments, or as a single list.
::mapslippypointcenterpoint...
::mapslippypointcenter-listpoint-list
These two commands compute the center of the bounding box for the specified set of points.
When no points are specified the center is "00".
The locations are specified as either a varying number of arguments, or as a single list.
::mapslippypointdiameterpoint...
::mapslippypointdiameter-listpoint-list
These two commands compute the diameter for the specified set of points, in pixels. The diameter
is the maximum of the pair-wise distances between all locations.
When less than two points are specified the diameter is "0".
The locations are specified as either a varying number of arguments, or as a single list.
::mapslippypoint2geozoompoint
This command converts the point in the canvas, for the specified zoom level, to a geograhical
location, and returns that location.
::mapslippypoint2geo*zoompoint...
::mapslippypoint2geo-listzoompoint-list
These two commands are extensions of mapslippypoint2geo which take a series of points as either
a varying number of arguments or a single list, convert them all to geographical locations as per
the specified zoom level and return a list of the results.
::mapslippypointsimplifyradialthresholdpoint-list
This command takes a path of points (as a single list), simplifies the path using the RadialDistance algorithm and returns the simplified path as list of points.
In essence the algorithm keeps only the first of adjacent points nearer to that first point than
the threshold, and drops the others.
::mapslippypointsimplifyrdppoint-list
This command takes a patch of points (as a single list), simplifies it using the non-parametricRamer-Douglas-Peucker algorithm and returns the simplified path as list of points.
::mapslippypretty-distancex
This methods formats the distance x (in meters) for display and returns the resulting string
(including the chosen unit).
Sub-kilometer distances are limited to 2 decimals, i.e. centimeters, whereas Kilometers are
limited to 3 decimals, i.e. meters.
::mapslippytileslevel
This command returns the width/height of a slippy-based map at the specified zoom level, in tiles.
::mapslippytilesize
This command returns the width/height of a tile in a slippy-based map, in pixels.
::mapslippytilevalidzoomrowcolumnlevels ?msgvar?
This command checks if the tile described by zoom, row, and column is valid for a slippy-based map
having that many zoom levels, or not. The result is a boolean value, true if the tile is valid,
and false otherwise. In the latter case a message is left in the variable named by msgvar, should
it be specified.
::mapslippyvalidlatitudex
This commands tests if the argument x is a valid latitude value, and returns the boolean result of
that test. I.e. true if the value is valid, and false else.
::mapslippyvalidlongitudex
This commands tests if the argument x is a valid longitude value, and returns the boolean result
of that test. I.e. true if the value is valid, and false else.