Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cldellow opened this issue Jan 13, 2024 · 0 comments
Open

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

cldellow opened this issue Jan 13, 2024 · 0 comments

Comments

@cldellow
Copy link
Owner

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant