[Tile-serving] [openstreetmap/osm2pgsql] Re-do Lua API (#901)

Paul Norman notifications at github.com
Wed Jan 16 22:41:57 UTC 2019


Now that we have experience with the Lua API, the multi-backend, and have new feature requests which require API changes, we should redo the API.

To allow a transform to be compatible with current API we can use different function names, and then a transform can implement both entry points reasonably easily.

The current API is

```lua
function filter_tags_node(tags, num_tags)
return filter, tags

function filter_tags_way(tags, num_tags)
return filter, tags, polygon, roads

function filter_basic_tags_rel(tags, num_tags)
return filter, tags

function filter_tags_relation_member(tags, member_tags,
    roles, num_members)
return filter, tags, member_superseded, boundary,
    polygon, roads
```

Experience has shown num_tags is not needed because we're not in C. `next(tags) == nil` does the same check, is more idiomatic Lua, and is faster.

With old-style MP support gone, we don't need the superseded tests.

New features desired are
- Knowing if a way is closed or not to determine area formation (blocks recreation of C transform in multi backend)
- Allowing columns on objects from ways to be set based on relations they are a member of #230 

What other changes do we want to make?

cc @kevinkreiser @systemed

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/901
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20190116/be121125/attachment.html>


More information about the Tile-serving mailing list