[OSM-dev] Processing dual carriageway highways into one linestring?`

Richard Fairhurst richard at systemed.net
Fri Oct 18 13:27:23 UTC 2019


Joseph Eisenberg wrote:
> Is anyone aware of a way to import dual-carriageway roads as
> a single linestring?

I do something like this to boil route relations containing dual
carriageways down into polylines:

insert into routes_split(geom) (
  select (st_dump(
    st_linemerge(
      st_approximatemedialaxis(
        st_simplifypreservetopology(
          st_multi(
            st_buildarea(
              st_buffer( st_collect(r.way) ,50 )
            )
          )
        ,20)
      )
    )
  )
).geom from (select way from routes where osm_id in (#{ids})) r )

But it's not an all-purpose solution, just something that works at small
scales (where junctions are unlikely to be significant) and for route
reconstruction purposes. I doubt very much that this approach would work
with osm-carto's principle of no preprocessing.

Richard



--
Sent from: http://gis.19327.n8.nabble.com/Developer-Discussion-f5233107.html



More information about the dev mailing list