Documentation
¶
Overview ¶
Package utils implements functions to calculate tiles range according to the given coordinates.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLvlParse = errors.New("cannot parse levels")
ErrLvlParse raises in case if the level string is incorrect.
View Source
var ErrLvlRange = errors.New("levels range is broken")
ErrLvlRange raises in case if one of the levels is out of range 0-16.
Functions ¶
func FindTiles ¶
func FindTiles(fromLvl, toLvl, accuracy int, fld float64, coords *Coordinates)
FindTiles calculates tiles range for given parameters and prints it.
Example ¶
fromLvl, toLvl, accuracy := 10, 10, -1 fld := float64(5) coords := &Coordinates{"maxLat": 60.120754, "maxLon": 30.699476, "minLat": 59.805323, "minLon": 30.024240} FindTiles(fromLvl, toLvl, accuracy, fld, coords)
Output: For level 10 y range = 4261 - 4270, x range = 5974 - 5993 Min coordinates: 59.80078125, 30.0234375 Max coordinates: 60.15234375, 30.7265625
Types ¶
type Coordinates ¶
Coordinates represents map with coordinates.
func GetCoordinates ¶
func GetCoordinates(args []string) (*Coordinates, error)
GetCoordinates parses coordinates from the given parameters.
Click to show internal directories.
Click to hide internal directories.