Git Product home page Git Product logo

libh3's Introduction

libh3 - Wrapper for Uber’s H3 Hexagonal Hierarchical Spatial Index in Rust

This crate calls functions provided by libh3-sys to expose a safe Rust API for the H3 library.

Contributions are welcome.

See the documentation here:

https://docs.rs/libh3/

libh3's People

Contributors

rustyconover avatar

Stargazers

FNCS avatar J.B.C avatar Max Schrader avatar AK avatar Andrew Potter avatar ____tg avatar Jiachun Tao avatar Romain Leroux avatar Bernhard Schuster avatar Clément Renault avatar Matthew Perry avatar Peter Popov avatar Derek Ammerman avatar ad hoc avatar Dave Harlan avatar Scott Crossen avatar Andy Gnias avatar  avatar

Watchers

 avatar James Cloos avatar

libh3's Issues

Resolution going from 0 -> 8 for GeoCoord (0, 0)

For the input (0, 0)

pub fn h3ids(lat: u64, lng: u64) -> Vec<String> {
  let geocoord = GeoCoord {
    lat: degs_to_rads((lat as f64) / 10_000_000f64),
    lon: degs_to_rads((lng as f64) / 10_000_000f64),
  };
  let mut ostream = vec![format!("{}-{}", 0, 0)];
  for resolution in 1..8 {
    let index = geo_to_h3(&geocoord, resolution - 1).unwrap();
    ostream.push(format!("{}-{}", resolution, index));
  }
  return ostream;
}

getting these values

In english, res from 0 -> 8, lng = lat = 0

"0-578536630256664575"
"1-583031433791012863"
"2-587531734883500031"
"3-592035265791393791"
"4-596538564771053567"
"5-601042424243945471"
"6-605546023066009599"

Any thoughts why that might be the case? I assume this isn't expected...

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.