With the advent of the 'flex' backend in osm2pgsql, it now appears once more that osm2pgsql is fit for purpose to maintain the tables needed to track membership in route relations for placement of pictorial highway shields. This feature request is being created to track that development.
The idea is that the osm2pgsql style sheet can maintain these tables with additional calls to a new module, shieldtables.lua. This module will allow the following calls:
local shieldtables = require 'shieldtables'
local shieldt = shieldtables.new(prefix)
These will be called in the initialization of the style sheet, to create the object that manages the two new tables.
prefix is the table name prefix; default is planet_osm.
shieldt:process_way(object);
Must be called from osm2pgsql.process_way. In phase 2, creates any needed rows in the shieldway table for ways that bear highway numbers.
shieldt:process_relation(object)
Must be called from osm2pgsql.process_relation. Creates any needed rows in the shieldroute table to describe route relations.
return shieldt:select_relation_members(object)
Must be called from osm2pgsql.select_relation_members. Returns a table with a single key, ways, which in turn is a table of OSM ID's of ways that require phase 2 processing because they participate in route relations.
This appears to be much more in keeping with the usual workflow than would a switch to a different tool such as imposm3.
It also allows keeping a rough equivalent to the current conversion style, by adding the calls above to compatible.lua.
Much more work needs to be done, but forward progress is starting again.
With the advent of the 'flex' backend in
osm2pgsql
, it now appears once more thatosm2pgsql
is fit for purpose to maintain the tables needed to track membership in route relations for placement of pictorial highway shields. This feature request is being created to track that development.The idea is that the
osm2pgsql
style sheet can maintain these tables with additional calls to a new module,shieldtables.lua
. This module will allow the following calls:These will be called in the initialization of the style sheet, to create the object that manages the two new tables.
prefix
is the table name prefix; default isplanet_osm
.Must be called from
osm2pgsql.process_way
. In phase 2, creates any needed rows in theshieldway
table for ways that bear highway numbers.Must be called from
osm2pgsql.process_relation
. Creates any needed rows in theshieldroute
table to describe route relations.Must be called from
osm2pgsql.select_relation_members
. Returns a table with a single key,ways
, which in turn is a table of OSM ID's of ways that require phase 2 processing because they participate in route relations.This appears to be much more in keeping with the usual workflow than would a switch to a different tool such as
imposm3
. It also allows keeping a rough equivalent to the current conversion style, by adding the calls above tocompatible.lua
.Much more work needs to be done, but forward progress is starting again.