morecantile.utils
morecantile.utils ¶
morecantile utils.
_parse_tile_arg ¶
_parse_tile_arg(*args) -> Tile
Parse the *tile arg of module functions
Copy from github.com/mapbox/mercantile/blob/master/mercantile/__init__.py
Parameters¶
tile : Tile or sequence of int May be be either an instance of Tile or 3 ints, X, Y, Z.
Returns¶
Tile
Raises¶
TileArgParsingError
bbox_to_feature ¶
bbox_to_feature(west: float, south: float, east: float, north: float) -> dict
Create a GeoJSON feature from a bbox.
check_quadkey_support ¶
check_quadkey_support(tms: list) -> bool
Check if a Tile Matrix Set supports quadkeys
lons_contain_antimeridian ¶
lons_contain_antimeridian(lon1: float, lon2: float) -> bool
meters_per_unit ¶
meters_per_unit(crs: CRS) -> float
Coefficient to convert the coordinate reference system (CRS) units into meters (metersPerUnit).
From note g in docs.opengeospatial.org/is/17-083r2/17-083r2.html#table_2: If the CRS uses meters as units of measure for the horizontal dimensions, then metersPerUnit=1; if it has degrees, then metersPerUnit=2pa/360 (a is the Earth maximum radius of the ellipsoid).
point_in_bbox ¶
point_in_bbox(point: Coords, bbox: BoundingBox, precision: int = 5) -> bool
Check if a point is in a bounding box.
truncate_coordinates ¶
truncate_coordinates(lng: float, lat: float, bbox: BoundingBox) -> tuple[float, float]
Truncate coordinates to a given bbox.
Adapted from github.com/mapbox/mercantile/blob/master/mercantile/__init__.py