openbikesensor / portal

OpenBikeSensor data collection portal
GNU Lesser General Public License v3.0
36 stars 17 forks source link

Reorganize roads into segments #115

Open opatut opened 2 years ago

opatut commented 2 years ago

This will be a rather complex task. Basically, we'll need to do something similar to building a routable database, where we normalize the OSM roads to our needs. This includes:

Maybe in a later stage we can go even crazier:

I'm not sure which kind of technology could be used for this. Building this directly in osm2pgsql sounds unreasonably complicated, I don't think Lua has the libraries for that. I'd love to be proven wrong though ;)

The naive approach would import a lot of stuff into memory, then iterate over ways and try to fix them. This sounds like it would quickly go O(n^2) or worse though. It might make sense to do some smart spatial organization for this. It probably also needs a few passes over the dataset, similar to what I describe above, and storing in GeoJSON in between is probably going to be huge in memory and very slow. Remember, we'll want to do this with e.g. the whole highways network of Germany, which is ~3GB of spatial data in postgis (I think).

So the details of this are not clear to me yet, but we should do it sometime soon so we can have proper analysis on road segments that make sense for our application.

opatut commented 2 years ago

https://github.com/simra-project/osmPreparation

I guess we should talk to our friends at SimRa ;)