1 stable release
new 1.0.0 | Jan 19, 2025 |
---|
#133 in Geospatial
5KB
webmercator_tiles
Rust crate to convert lon/lat coordinates to Web Mercator tiles.
See https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames for details.
Example
use webmercator_tiles;
fn main() {
let t2l = webmercator_tiles::tile2lonlat(4376, 2932, 13); // (12.3046875, 45.460130637921)
let l2t = webmercator_tiles::lonlat2tile(14.016667, 42.683333, 13); // (4414, 3019)
println!("Tile (4376, 2932) at zoom 13: {t2l:?}");
println!("lon 14.016667 lat 42.683333 at zoom 13: {l2t:?}");
}
lib.rs
:
Web Mercator Tiles
Rust crate to convert lon/lat coordinates to Web Mercator tiles.
See https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames for details.
Warning
All the functions provided by this crate do not check the validity of the input. However, since they are based on equations, they will still return an (invalid) result.