{"id":27624453,"url":"https://github.com/mthh/distance-cartogram-rs","last_synced_at":"2025-04-23T11:45:57.239Z","repository":{"id":268423374,"uuid":"899599915","full_name":"mthh/distance-cartogram-rs","owner":"mthh","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-24T13:02:52.000Z","size":3537,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-24T14:22:37.020Z","etag":null,"topics":["cartogram","distance-cartogram","rust-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mthh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-12-06T15:49:59.000Z","updated_at":"2025-02-24T13:10:06.000Z","dependencies_parsed_at":"2024-12-16T17:42:36.715Z","dependency_job_id":"b24eadf5-00e4-4a2c-9f83-d93447b9b045","html_url":"https://github.com/mthh/distance-cartogram-rs","commit_stats":null,"previous_names":["mthh/distance-cartogram-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthh%2Fdistance-cartogram-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthh%2Fdistance-cartogram-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthh%2Fdistance-cartogram-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthh%2Fdistance-cartogram-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mthh","download_url":"https://codeload.github.com/mthh/distance-cartogram-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250430579,"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":["cartogram","distance-cartogram","rust-library"],"created_at":"2025-04-23T11:45:54.021Z","updated_at":"2025-04-23T11:45:57.228Z","avatar_url":"https://github.com/mthh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distance-cartogram-rs\n\nA Rust implementation of distance cartogram (based on Waldo Tobler and Caulette Cauvin work) to be used\nto create a fast distance cartogram package for R.\n\n\n\u003e **Notes**:\n\u003e - This is a port of the **[Darcy](https://thema.univ-fcomte.fr/productions/software/darcy/)** standalone software regarding the bidimensional regression and the backgrounds layers deformation.  \nAll credit for the contribution of the method goes to **Colette Cauvin** *(Théma - Univ. Franche-Comté)* and for the reference Java implementation goes to **Gilles Vuidel** *(Théma - Univ. Franche-Comté)*.\n\u003e - This method is also available as a **QGIS plugin** ([GitHub repository](https://github.com/mthh/QgisDistanceCartogramPlugin) / [QGIS plugin repository](https://plugins.qgis.org/plugins/dist_cartogram/)).\n\n### Usage\n\n_**From R**_:\n\nSee the [**distanamo** R package](https://github.com/riatelab/distanamo) that wraps this library.\n\n_**From Rust**_:\n\n**Core feature**:\n\nThe core feature provided by this library is a `Grid` struct that have to be initialized from two sets of homologous\npoints (called the *source points* and the *image points*, and provided as two `\u0026[geo_types::Coord\u003cf64\u003e]`).\n\nDuring the initialization, a grid is created and the initial interpolation step is performed.\n\nThe grid can then be used to deform a set of points (provided as a `\u0026[geo_types::Geometry]` - all types of geometries\nare supported) to their corresponding positions in the cartogram.\n\n**Additional features**:\n\nThis crate also provides a `move_points` function (under the `moving-points-unipolar` feature gate) that can be used to create\nthe images points from the source points and the time between them (this is a unipolar displacement - based on a reference point that is\nnot moved - used for unipolar distance cartograms).\nThis function returns the *image points* that can be used with the `Grid` struct to create distance cartograms.\n\nThis crate also provides a `generate_positions_from_durations` function (under the `moving-points-multipolar` feature gate) that can be used to create\nthe images points from the durations between all the source points (this is a multipolar displacement - there is no reference point, all the points might be moved - used for multipolar distance cartograms).\nInternally this function performs [Principal Coordinates Analysis (PCoA)](https://en.wikipedia.org/wiki/Multidimensional_scaling#Classical_multidimensional_scaling) on the durations matrix to get the relative positions of the points. We say \"relative positions\" because the points returned are still centered on (0, 0) and can't be used directly to create a distance cartogram. \n\nYou then need to fit these points to the source points (using either the `adjustment::adjust` or the `procrustes::procrustes` function) to get the final image points that can be used with the `Grid` struct to create distance cartograms.\n\nSee the examples in the [`examples`](./examples) directory for more details:\n\n- from two sets of points: [`from-2-point-layers`](./examples/from-2-point-layers.rs) (`cargo run --example from-2-point-layers --release`), demonstrating the `Grid` core feature.\n- from a reference point and durations: [`from-reference-point-and-durations`](./examples/from-reference-point-and-durations.rs) (`cargo run --example from-reference-point-and-durations --features moving-points-unipolar --release`), demonstrating the `move_points` function then the `Grid` core feature.\n- from points and durations matrix: [`from-points-and-durations-matrix`](./examples/from-points-and-durations-matrix.rs) (`cargo run --example from-points-and-durations-matrix --features moving-points-multipolar --release`), demonstrating the `generate_positions_from_durations` function then the `Grid` core feature.\n\n_**From R**_:\n\nThe [distanamo R package](https://github.com/riatelab/distanamo) wrapping this library is currently under development.\n\n### License\n\n**GPL-3.0**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthh%2Fdistance-cartogram-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmthh%2Fdistance-cartogram-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthh%2Fdistance-cartogram-rs/lists"}