{"id":27624655,"url":"https://github.com/atsyplenkov/quadbin","last_synced_at":"2025-04-23T11:56:02.742Z","repository":{"id":289239012,"uuid":"968384872","full_name":"atsyplenkov/quadbin","owner":"atsyplenkov","description":"Rust crate for Quadbin spatial indexing","archived":false,"fork":false,"pushed_at":"2025-04-23T06:58:38.000Z","size":79,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T11:55:53.244Z","etag":null,"topics":["dggs","georust","spatial-index"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atsyplenkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-18T02:03:28.000Z","updated_at":"2025-04-23T07:02:24.000Z","dependencies_parsed_at":"2025-04-22T09:39:46.358Z","dependency_job_id":null,"html_url":"https://github.com/atsyplenkov/quadbin","commit_stats":null,"previous_names":["atsyplenkov/quadbin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsyplenkov%2Fquadbin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsyplenkov%2Fquadbin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsyplenkov%2Fquadbin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atsyplenkov%2Fquadbin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atsyplenkov","download_url":"https://codeload.github.com/atsyplenkov/quadbin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250430593,"owners_count":21429323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dggs","georust","spatial-index"],"created_at":"2025-04-23T11:56:02.067Z","updated_at":"2025-04-23T11:56:02.736Z","avatar_url":"https://github.com/atsyplenkov.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quadbin\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/atsyplenkov/quadbin/blob/main/LICENSE) \n[![crates.io](https://img.shields.io/crates/v/quadbin.svg?logo=rust)](https://crates.io/crates/quadbin) \n[![Build \u0026 Test](https://github.com/atsyplenkov/quadbin/actions/workflows/rust.yml/badge.svg)](https://github.com/atsyplenkov/quadbin/actions/workflows/rust.yml)\n[![codecov](https://codecov.io/gh/atsyplenkov/quadbin/graph/badge.svg?token=4SZ4RI3ILS)](https://codecov.io/gh/atsyplenkov/quadbin)\n\nA Rust implementation of Quadbin, a hierarchical geospatial index tiling approach developed by [CARTO](https://github.com/CartoDB). Like the [Microsoft's Bing Maps Tile System](https://docs.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system) (aka Quadkey), Quadbin uniformly subdivides a map in Mercator projection into four squares at different resolution levels, from 0 to 26 (less than 1 m² at the equator). However, unlike Quadkey, Quadbin stores the grid cell index in a 64-bit integer.\n\nThis crate is a complete rewrite of the original implementation in [JavaScript](https://github.com/CartoDB/quadbin-js) and [Python](https://github.com/CartoDB/quadbin-py). Learn more about Quadbin in the [CARTO documentation](https://docs.carto.com/data-and-analysis/analytics-toolbox-for-snowflake/sql-reference/quadbin).\n    \n\n## Example\n\n```rust\nuse quadbin::Cell;\nuse approx::assert_relative_eq;\n\n// Convert a point into a Quadbin cell\nlet longitude = -3.7038;\nlet latitude = 40.4168;\nlet resolution = 10_u8;\nlet qb = Cell::from_point(longitude, latitude, resolution);\nassert_eq!(qb, Cell::new(5234261499580514303_u64));\n\n// Get a point from a Quadbin cell\nlet coords = Cell::new(5209574053332910079_u64).to_point();\nassert_eq!(coords, (33.75, -11.178401873711776));\n\n// Quadbin resolution at equator in m²\nlet area = Cell::from_point(0.0, 0.0, 26).area_m2();\nassert_relative_eq!(area, 0.36, epsilon = 1e-2)\n```\n\n## Quadbin vs. Quadkey\nTBA.\n\n## Reasoning\nThis repository is a proof-of-concept project, where I practised writing Rust code, and, moreover, writing Rust and R bindings as a single project. Recently, I was excited by the newly proposed  [`raquet`](https://github.com/CartoDB/raquet) format by [CARTO](https://github.com/CartoDB) for storing raster data in Parquet files and was eager to try it in my projects. However, the `raquet` file specification and conversion are written in pure Python and heavily relies on `gdal`; therefore, instead of implementing R-to-Python, I decided to rewrite everything in Rust, merely for fun and practice. This repository is the first step towards native, GDAL-free raster to `raquet` conversion.\n\n## License and Attribution\nThis project includes a reimplementation of logic based on [`quadbin-py`](https://github.com/CartoDB/quadbin-py) by CARTO, which is licensed under the BSD 3-Clause License.\nSee [`LICENSE-THIRD-PARTY`](LICENSE-THIRD-PARTY) for full license text.\n\n## See also\n* [`quadbin-js`](https://github.com/CartoDB/quadbin-js) and [`quadbin-py`](https://github.com/CartoDB/quadbin-py) — original implementation in JavaScript and Python by CARTO\n* [`geo-quadkey-rs`](https://github.com/masaishi/geo-quadkey-rs) — a Rust crate for QuadKey, the original implementation of Microsoft's Bing Maps Tile System\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatsyplenkov%2Fquadbin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatsyplenkov%2Fquadbin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatsyplenkov%2Fquadbin/lists"}