Module wm

Source
Expand description

All WM tooling

Structs§

ClipLineResult
After clipping a line, return the altered line, the offset the new line starts at, and if the line is ccw
ClipLineResultWithBBox
Ensuring vec_bbox exists
LonLat
This class represents a point on the unit sphere as a pair of latitude-longitude coordinates. Like the rest of the “geometry” package, the intent is to represent spherical geometry as a mathematical abstraction, so functions that are specifically related to the Earth’s geometry (e.g. easting/northing conversions) should be put elsewhere.
TileChildren
The children of a tile

Enums§

Source
The source of the coordinate inputs

Functions§

altitude_from_mercator_z
Convert mercator projection’s Z-Value to altitude returns the altitude
altitude_to_mercator_z
Convert altitude to mercator projection Z-Value returns the Z-Value
bbox_to_xyz_bounds
Convert a bbox of the form [w, s, e, n] to a tile’s bounding box in the form of { minX, maxX, minY, maxY } The bbox can be in lon-lat (WGS84) or WebMercator (900913) The default expectation is in WebMercator (900913) returns the tile’s bounding box
circumference_at_latitude
The circumference at a line of latitude in meters.
clip_line
clip an input line to a bounding box Data should always be in a 0->1 coordinate system to use this clip function
convert_bbox
Convert a bbox of the form [w, s, e, n] to a bbox of the form [w, s, e, n] The result can be in lon-lat (WGS84) or WebMercator (900913)
get_zoom_size
Given a zoom and tilesize, build mercator positional attributes
lat_from_mercator_y
Convert mercator projection’s Y-Value to latitude returns the latitude
lat_to_mercator_y
Convert latitude to mercator projection Y-Value returns the Y-Value
ll_to_merc
Convert Longitude and Latitude to a mercator x-y coordinates Return the mercator x-y coordinates
ll_to_px
Convert Longitude and Latitude to a mercator pixel coordinate Return the mercator pixel coordinate
ll_to_tile
Convert a lat-lon and zoom to the tile’s x-y coordinates Return the tile x-y
ll_to_tile_px
given a lon-lat and tile, find the offset in pixels return the tile xy pixel
lng_from_mercator_x
Convert mercator projection’s X-Value to longitude returns the longitude
lng_to_mercator_x
Convert longitude to mercator projection X-Value returns the X-Value
merc_to_ll
Convert mercator x-y coordinates to Longitude and Latitude Return the Longitude and Latitude
mercator_lat_scale
Determine the Mercator scale factor for a given latitude, see https://en.wikipedia.org/wiki/Mercator_projection#Scale_factor
px_to_ll
Convert mercator pixel coordinates to Longitude and Latitude Return the Longitude and Latitude
px_to_tile
Convert a pixel coordinate to a tile x-y coordinate Return the tile x-y
split_tile
@param tile - the tile to split @param buffer - the buffer around the tile for lines and polygons @returns - the tile’s children split into 4 sub-tiles
tile_to_bbox
Convert a tile x-y-z to a bbox of the form [w, s, e, n] Return the bbox
xyz_to_bbox
Convert a tile x-y-z to a bbox of the form [w, s, e, n] The result can be in lon-lat (WGS84) or WebMercator (900913) The default result is in WebMercator (900913)