Giter Club home page Giter Club logo

slide's Introduction

Slide: Vector to Raster Map Conflation

Slide is an algorithm/approach for conflating vector data with raster data. The idea is to take a coarse approximation to the raster data and have the algorithm slide the polyline to the "image." The result is a properly sampled vector polyline matching the contours of the raster data.

The algorithm is presented as a Go (golang) library. The examples directory has some example integrations. Most of the heavy geometry stuff is done with go.geo, a go geography/geometry library.

Demos

Slide supports the concept of surfacers that can be based on any datasource.

Background

Slide was first developed as a tool to slide Open Street Map map geometry to the Strava Global Heatmap dataset. The 200,000,000,000 Strava GPS points were bucketed by pixel to create the heatmap and essentially creating a raster like density distribution of GPS data. For more information take a look at the links below:

Slide Animation


**Above:** The black polyline is being "slided" to the green path, matching the Strava global heatmap data. Red lines are the intermediate steps of the refinement.

Algorithm Overview

At a high level, Slide works by modeling an input line, or string, sliding into the valleys of a surface. The surface can be built from any datasource.

One can imagine a coarse input "string of beads" being placed on the surface and letting gravity pull it downward. When movement stops, the string should follow the valleys.

Details

To mimic the flexibility of a "string of beads," or something similar, the input line is resampled. This allows the discretely sampled line to still behave like a naturally flexible object.

This resampled line is then ran through a loop where each vertex or point is corrected based on a cost function. This cost function has 3 main parts:

  • Depth with respect to the surface
  • Equal distance between resampled points (smooth parametric derivative)
  • Maximize vertex angles (smooth parametric second derivative)

The components are weighted with the surface getting the most. The other parts are to ensure the line doesn't collapse in on itself and maintains some sense of rigidity. To speed conversion of the process, a momentum component is added where a fraction of the correction from the previous loop is added in.

Once the process converges, the line is simplified again and sent back as the result.

Slide Algorithm Overview

Potential improvement

Many! There are the basic things like improving the cost function weightings as well as more challenging things such as incorporating more information from the input data, such as direction. I'd also like to support the sliding of more complex goemetries, such as a road grid.

Related Work

As they say, "There is nothing new under the sun."

slide's People

Contributors

paulmach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slide's Issues

Finding highway names

Hi Paul

I have hundreds and thousands of data points coming from all over India from several hundred users, who are travelling either within cities or between cities.

I wish to extract highway names for all the users who are travelling between cities(after ignoring data points from within city limits)

Is slide useful for this purpose? or is there any other tool or library/service that you recommend.

Attempt to get this working again

Hi, since I think this is a really great tool with a bunch of potential, I thought I might try to revive it.
Wasn't really able to get anywhere yet, but I modified the TIGER example and pointed it at some locally cached heatmap tiles, but I'm only getting bad results. Perhaps my params are weird or ...
See example below:

I pushed my code over at master...greenbigfrog:slide:wip

Perhaps someone has some input on what I might be doing wrong.

How do *I* help this project get to the latest version of iD?

I want to help here. I think Slide is an invaluable tool for the world. I cant believe no one else besides @paulmach is involved - and maybe even paul has dropped it for other work. Id like to help. What are some of the meta steps I can do in order to go and run this on my own server and integrate it in with a newer version of iD? Where should I host it? Where did the current iD example host? Just looking for a paragraph answer to point me in right direction...Thanks!

Is the heat map currently updating or has it been sunset?

Hi Paul,
Thank you so much for this tool and for your efforts within Strava to allow some great data available to improve OSM. It's always a fine line when opening access.

I was looking at a new bike path opened six weeks ago but no Strava data. Now obviously there is a delay to getting the data into heat maps but wondered if this was a now a snapshot?

The reason for this question is that DigitalGlobe have released two image sets for OSM editors which appear to be far superior than Bing in places and more up to date and I would like to look at adding both sets into your ID version as a starter.
OSM: https://www.openstreetmap.org/edit#map=19/-37.96520/145.13455
SID: https://strava.github.io/iD/#background=Bing&map=19.00/145.13473/-37.96531

image
image

Unable to connect to API

Hello.

This is probably my computer's issue instead of a project's issue but this is the only way I found to contact Paul.

Since the beginning of the year, I cannot save my changes anymore. Somebody is unable to connect to API. I don’t know if Strava, the iD editor, Open Street Maps or Github.

If I clear all my caches and local data and remove all authorizations I may have given, then I can go to the iD editor with Slide add-on and everything will be there: the Strava heatmap, the Open Street Maps roads and paths, the local GPX file I may upload,… I can make the changes as usual. Then I clic on the save button and Open Street Map request my authorization which I gladly give, but that’s the end of it. The changes will remain local and I will be shown a message saying “Unable to connect to API.”

If I do not clear my caches and local data, then, when I go the iD editor with Slide add-on, I will only see the Bing background with the Strava heatmap but no Open Street Maps features and still the "Unable to connect to API” message.

screen shot 2018-01-14 at 19 19 40

Is there anything I can change in my computer to fix the issue and be able to edit the maps as I have been doing for years?

Thanks a lot for your help. Best regards.

Strava Login

Strava has changed its security settings, so to use the heatmap in the id editor really needs you to be logged into Strava but theres no options for actually logging in

is any fix available ?

Can't upload changes

Perhaps iD version is outdated?

Please ensure you are connected to the internet.
Server returned status code undefined

Slide moving other roads along corrected road?

Hi, not sure this is the right place to post it, but I was looking at Trinidad and noticed what might be a bug with Slide.

It looks like a user used Slide to align a road to the Strava tracks, and it moved the nodes for where the side streets connect to the main street so they were misaligned -- not sure if that was user error or maybe something funky with Slide itself. It seems like it did the alignment of the target road successfully but moved the nodes along the line.I've attached below the image from JOSM and from regular OSM before it was fixed.

This is the changeset (I think) that caused the issue, it was awhile ago so maybe that is fixed, but it persisted until just recently when someone fixed it. https://www.openstreetmap.org/changeset/36207456
It's here specifically https://www.openstreetmap.org/#map=18/10.716196/-61.477808

screen shot 2016-08-17 at 11 56 56 am

stravaslidetooloffsetnodes-2

Closed ways

Currently it unglues first and last point when a closed highway

Slide not doing anything

Hi

I'm new to this (GIT) so please tell me if I don't follow the practices/etiquette.

I've been trying to use Strava Slide to update trails in Open Street Map - there is a Slide plugin on this page: https://strava.github.io/iD/#background=Bing&id=w54292996&map=17.60/11.74480/57.71357, that should be possible to use to update OSM - when using it, nothing happens though.

I've also tried the demo: https://labs.strava.com/slide/demo.html#16/-122.54277/38.05392, though there's no heat data being shown and when trying anyway, you get a server error message.

Is Slide "down" or is the problem on my side?

Unable to Save Edits, Possible OAuth Problem

I've tried a number of browsers but I cannot save edits anymore. The OSM OAuth popup window comes up asking me to grant access repeatedly but won't go past that. If I restart my session, the popup window comes up, but there is no content in it. The url for it is about: blank.

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.