Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. -- Nodes will only be processed if one of these keys is present
  2.  
  3. node_keys = { "amenity", "shop" }
  4.  
  5. -- Initialize Lua logic
  6.  
  7. function init_function()
  8. end
  9.  
  10. -- Finalize Lua logic()
  11. function exit_function()
  12. end
  13.  
  14. -- Assign nodes to a layer, and set attributes, based on OSM tags
  15.  
  16. function node_function(node)
  17. --  local amenity = node:Find("amenity")
  18. --  local shop = node:Find("shop")
  19. --  if amenity~="" or shop~="" then
  20. --      node:Layer("pois", false)
  21. --      if amenity~="" then node:Attribute("type",amenity)
  22. --      else node:Attribute("type",shop) end
  23. --      node:Attribute("name", node:Find("name"))
  24. --  end
  25. end
  26.  
  27. -- Similarly for ways
  28.  
  29. function way_function(way)
  30.     local area_highway = way:Find("area:highway")
  31.     if area_highway~="" then
  32.         way:Layer("area_highway", true)
  33.         way:Attribute("surface", way:Find("surface"))
  34.         way:Attribute("type",area_highway)
  35. --      way:Attribute("id",way:Id())
  36. --      way:AttributeNumeric("area",37)
  37.     end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement