Code Monkey home page Code Monkey logo

slippy-map-tiles-rs's Introduction

slippy-map-tiles-rs's People

Contributors

amandasaurus avatar luogni avatar

Stargazers

eugene avatar ringsaturn avatar Edgars Košovojs avatar Tim Docker avatar Luke Frisken avatar  avatar

Watchers

 avatar James Cloos avatar

slippy-map-tiles-rs's Issues

merc_location_to_tile_coords seems to produce incorrect tile position

To me it seems that merc_location_to_tile_coords with zoom values other than 8 produces incorrect positions inside a tile. For example

let paris = (48.864716, 2.349014);

let latlon = slippy_map_tiles::LatLon::new(paris.0 as f32, paris.1 as f32)
    .unwrap()
    .to_3857();

info!("3857 {:?}", latlon);
// 3857 (261491.05, 6251937.5)
// This seems to be the correct 3857 location

let tile_coord =
    slippy_map_tiles::merc_location_to_tile_coords(latlon.0 as f64, latlon.1 as f64, 8);
info!("pos {:?}", tile_coord);
// pos ((129, 167), (171, 14))
// this is the correct location within this tile at zoom 8

with a zoom of 10, pos becomes:
pos ((518, 671), (174, 830)), which given a 256x256 image, is out of bounds. Lower values than 8 seem to work correctly on the x axis but leave y at zero, zoom 4:
pos ((8, 10), (26, 0))

It could be entirely possible that I am using the library incorrectly - if so, sorry in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.