Today, I tidied up, tested and committed a Lua module for processing highway shields in osm2pgsql.
I've tried to keep the design as non-intrusive as possible to people's existing workflow, assuming they already use the flex backend. There are just four changes needed to the Lua style file.
local shieldtables = require("shieldtables") local shieldt = shieldtables.new(prefix)where prefix is the prefix (e.g., planet_osm) being used in the database for the OSM tables.
shieldt:process_way(object);
shieldt:process_way(object);
shieldt:select_relation_members(object)with the same API that returns the necessary selection. For all the style sheets that I was using, I was able just to use:
function osm2pgsql.select_relation_members(object) return shieldt:select_relation_members(object) end
And that's pretty much it, for how to use it. The database tables prefix_shieldroute and prefix_shieldway are managed entirely by those procedures.
I still need to test to make sure that incremental update works with the new setup. If it does, that's half the job of making minutely updates work, I think.
No comments:
Post a Comment