{"id":30063925,"url":"https://github.com/josiahparry/anime","last_synced_at":"2025-08-08T04:49:51.393Z","repository":{"id":269165822,"uuid":"906283177","full_name":"JosiahParry/anime","owner":"JosiahParry","description":"Approximate Network Integration,  Matching, and Enrichment","archived":false,"fork":false,"pushed_at":"2025-07-18T18:31:51.000Z","size":25945,"stargazers_count":17,"open_issues_count":12,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-30T01:48:19.224Z","etag":null,"topics":["python","r-spatial","rstats","rust","transportation-network"],"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/JosiahParry.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}},"created_at":"2024-12-20T14:54:59.000Z","updated_at":"2025-07-23T06:00:05.000Z","dependencies_parsed_at":"2025-01-15T02:03:59.615Z","dependency_job_id":null,"html_url":"https://github.com/JosiahParry/anime","commit_stats":null,"previous_names":["josiahparry/anime"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JosiahParry/anime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosiahParry%2Fanime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosiahParry%2Fanime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosiahParry%2Fanime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosiahParry%2Fanime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JosiahParry","download_url":"https://codeload.github.com/JosiahParry/anime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JosiahParry%2Fanime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269366840,"owners_count":24405246,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["python","r-spatial","rstats","rust","transportation-network"],"created_at":"2025-08-08T04:49:31.974Z","updated_at":"2025-08-08T04:49:51.319Z","avatar_url":"https://github.com/JosiahParry.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ANIME: Approximate Network Integration, Matching, and Enrichment\n\n\nANIME is a fast and efficient algorithm to perform partial linestring\nmatching and attribute interpolation between two sets of linestrings.\n\nThe core algorithm is implemented in the `anime` Rust crate ([see Rust\ndocs](https://docs.rs/anime/)) with bindings to the algorithm in both R\nand Python.\n\n## What it does\n\nThe `anime` algorithm calculates the approximate shared length between\ntwo sets of linestrings within a specified **distance** and **angle**\ntolerance.\n\nFor each source linestring, the distance of overlap with a target\nlinestring is stored. The distance of overlap is then used to perform\nintensive or extensive interpolation of attributes.\n\n## Example\n\n``` r\nlibrary(sf)\nlibrary(dplyr)\nlibrary(anime)\nlibrary(ggplot2)\n\n# get sample lines from package\ntargets_fp \u003c- system.file(\"extdata\", \"maine-osm-targets.fgb\", package = \"anime\")\nsources_fp \u003c- system.file(\"extdata\", \"maine-tigris-sources.fgb\", package = \"anime\")\n\n# read files\ntargets \u003c- read_sf(targets_fp)\nsources \u003c- read_sf(sources_fp)\n\nmatches \u003c- anime(\n    sources,\n    targets,\n    10, 5\n)\n\n# extract matches as a data.frame\nmatch_tbl \u003c- get_matches(matches)\nmatch_tbl\n```\n\n    # A data frame: 23 × 5\n       target_id source_id shared_len source_weighted target_weighted\n     *     \u003cint\u003e     \u003cint\u003e      \u003cdbl\u003e           \u003cdbl\u003e           \u003cdbl\u003e\n     1         1         1       73.5           1.00            1.25 \n     2         2         1       50.0           0.680           0.933\n     3         3         1       73.5           1.00            0.991\n     4         4         2        0             0               0    \n     5         6         1        0             0               0    \n     6         7         2        0             0               0    \n     7         8         2        0             0               0    \n     8        11         1       18.7           0.255           0.752\n     9        12         2      170.            0.895           0.894\n    10        13         3      132.            0.983           0.993\n    # ℹ 13 more rows\n\n``` r\n# find most matched source\nmost_matched_source \u003c- count(match_tbl, source_id, sort = TRUE) |\u003e\n  slice(1) |\u003e\n  pull(source_id)\n\n# find the matched targets in the sf object\nmatched_tars \u003c- match_tbl |\u003e\n  filter(source_id == most_matched_source, shared_len \u003e 0) |\u003e\n  inner_join(transmute(targets, target_id = row_number())) |\u003e\n  st_as_sf()\n\n# visualize them\nggplot() +\n  geom_sf(aes(color = shared_len), matched_tars, lwd = 2) +\n  geom_sf(data = sources[most_matched_source, ], lty = 2) +\n  scale_color_binned() +\n  theme_void()\n```\n\n![](README_files/figure-commonmark/unnamed-chunk-1-1.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosiahparry%2Fanime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosiahparry%2Fanime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosiahparry%2Fanime/lists"}