{"id":13551156,"url":"https://github.com/paulmach/slide","last_synced_at":"2025-08-09T01:52:57.961Z","repository":{"id":20567047,"uuid":"23847290","full_name":"paulmach/slide","owner":"paulmach","description":"Vector to Raster Map Conflation","archived":false,"fork":false,"pushed_at":"2017-08-15T20:12:40.000Z","size":34,"stargazers_count":245,"open_issues_count":8,"forks_count":29,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-02T02:06:21.250Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://paulmach.github.io/slide","language":"Go","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/paulmach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-09T19:31:04.000Z","updated_at":"2025-03-16T09:31:19.000Z","dependencies_parsed_at":"2022-07-26T09:17:59.464Z","dependency_job_id":null,"html_url":"https://github.com/paulmach/slide","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paulmach/slide","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulmach%2Fslide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulmach%2Fslide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulmach%2Fslide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulmach%2Fslide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulmach","download_url":"https://codeload.github.com/paulmach/slide/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulmach%2Fslide/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269518567,"owners_count":24430637,"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":[],"created_at":"2024-08-01T12:01:43.394Z","updated_at":"2025-08-09T01:52:57.916Z","avatar_url":"https://github.com/paulmach.png","language":"Go","funding_links":[],"categories":["Go","others"],"sub_categories":[],"readme":"Slide: Vector to Raster Map Conflation\n======================================\n\nSlide is an algorithm/approach for conflating vector data with raster data. \nThe idea is to take a coarse approximation to the raster data and have the algorithm slide the polyline to the \"image.\"\nThe result is a properly sampled vector polyline matching the contours of the raster data.\n\nThe algorithm is presented as a Go (golang) library. The [examples](examples) directory has some example integrations.\nMost of the heavy geometry stuff is done with [go.geo](https://github.com/paulmach/go.geo), a go geography/geometry library.\n\n### Demos\n\nSlide supports the concept of [surfacers](surfacers) that can be based on any datasource.\n\n* [Strava Global Heat](http://labs.strava.com/slide/demo.html) \u003cbr /\u003e\n\tUses the [Strava Global Heatmap](http://labs.strava.com/heatmap/)\n\tto speed map tracing.\n\nBackground\n----------\n\nSlide was first developed as a tool to slide [Open Street Map](http://www.openstreetmap.org/) map geometry to the \n[Strava Global Heatmap](http://labs.strava.com/heatmap) dataset.\nThe 200,000,000,000 [Strava](http://strava.com) GPS points were bucketed by pixel to create the heatmap and essentially\ncreating a raster like density distribution of GPS data. For more information take a look at the links below:\n\n* [Strava Slide Overview](http://labs.strava.com/slide)\n* [Interactive Demo](http://labs.strava.com/slide/demo.html)\n* [OSM iD Editor Integration](http://strava.github.io/iD/#background=Bing\u0026map=16.97/-122.54464/38.05472)\n* Slide presented at State of the Map US 2014 [slides](http://labs.strava.com/slide/slide-SOTM-2014.pdf) | [video](https://vimeo.com/91878015).\n\n\u003cimg src=\"http://i.imgur.com/rbi2kDz.gif\" width=\"728\" height=\"330\" alt=\"Slide Animation\" style=\"float: right\" /\u003e\n\u003cbr /\u003e\n**Above:**\nThe black polyline is being \"slided\" to the green path, matching the Strava global heatmap data.\nRed lines are the intermediate steps of the refinement.\n\nAlgorithm Overview\n------------------\n\nAt a high level, Slide works by modeling an input line, or string, sliding into the valleys of a surface. \nThe surface can be built from any datasource.\n\nOne can imagine a coarse input \"string of beads\" being placed on the surface and letting gravity pull it downward.\nWhen movement stops, the string should follow the valleys.\n\n#### Details\n\nTo mimic the flexibility of a \"string of beads,\" or something similar, the input line is resampled.\nThis allows the discretely sampled line to still behave like a naturally flexible object.\n\nThis resampled line is then ran through a loop where each vertex or point is corrected based on a cost function.\nThis cost function has 3 main parts:\n\n* Depth with respect to the surface\n* Equal distance between resampled points (smooth parametric derivative)\n* Maximize vertex angles (smooth parametric second derivative)\n\nThe components are weighted with the surface getting the most. The other parts are to ensure the line doesn't\ncollapse in on itself and maintains some sense of rigidity.\nTo speed conversion of the process, a momentum component is added where\na fraction of the correction from the previous loop is added in.\n\nOnce the process converges, the line is simplified again and sent back as the result.\n\n\u003cimg src=\"http://i.imgur.com/WCjdlsc.png\" width=\"728\" height=\"407\" alt=\"Slide Algorithm Overview\" /\u003e\n\n#### Potential improvement\n\nMany! There are the basic things like improving the cost function weightings \nas well as more challenging things such as incorporating more information from the input data, such as direction.\nI'd also like to support the sliding of more complex goemetries, such as a road grid.\n\nRelated Work\n------------\n\nAs they say, \"There is nothing new under the sun.\"\n\n* [Google correcting Street View sensor data](http://google-opensource.blogspot.com/2012/05/introducing-ceres-solver-nonlinear.html)\n\tusing a nonlinear least squares solver.\n* [Active Contours, Deformable Models, and Gradient Vector Flow](http://www.iacl.ece.jhu.edu/static/gvf/)\n* [Snakes: Active Contour Models](http://www.cs.ucla.edu/~dt/papers/ijcv88/ijcv88.pdf), published 1988\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulmach%2Fslide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulmach%2Fslide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulmach%2Fslide/lists"}