Skip to content

mapt build --single: honour node_keys / way_keys #5

@cldellow

Description

@cldellow

If you write two slices:

node_keys = {"amenity"}

function node_function()
  Layer("amenity")
end

and

node_keys = {"tourism"}

function node_function()
  Layer("tourism")
end

and do mapt build, you will get two layers who each contain only amenity or tourism nodes.

If you do mapt build --single, you will get two layers who contain all nodes. This is because the merged driver file does not attempt to express your node_keys (or way_keys) to tilemaker, or filter on them before calling you.

So users need to write their functions defensively, e.g.:

node_keys = {"amenity"}

function node_function()
  if Find("amenity") == "" then return end
  Layer("amenity")
end

This is OK for a v1, but it'd be nicer if:

  • the driver enforced node_keys/way_keys before delegating to your function
  • the driver (when possible) expressed node_keys/way_keys to tilemaker, to allow it to optimize reading
    • it's not generally possible to do this for all permutations, but if your keys were all positive (i.e. no ~building entries), we could just union them all together

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions