21 Actions

Split all OSM roads within boundingbox in 20m segments and save to new tableI am calculating statistics from car routes, where i have several sensor readings. I want to calculate stuff like speed, co2 emissions and so on for all the segments. There are a lot of measurements, and calculating those statistics for the whole line segment (street) does not show for example standing time at an intersection. To actually do this the most correct way I would need to split the streets at intersections, or where the speed limit changes....but that is too complicated right now - this serves my purpose for now.

Split all OSM roads within boundingbox in 20m segments and save to new tableok I think this works, but sorry for being a complete SQL noob. I put it like this: SELECT ST_AsText(ST_MakeLine(start_point,end_point)) as geom FROM ( SELECT ST_Pointn(geom, generate_series(1, ST_NumPoints(geom)-1)) as start_point, ST_Pointn(geom, generate_series(2, ST_NumPoints(geom))) as end_point FROM ( SELECT ST_Segmentize(way,5) as geom FROM planet_osm_line ) as line ) as tmp; SO how can I now have all these segments saved, they should countain the same columns and attributes as the line they came from, of course with a different id